Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change basic example to contain backward two losses. #64

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

PierreQuinton
Copy link
Contributor

No description provided.

@ValerianRey
Copy link
Contributor

There is a warning when running doc tests:

=============================== warnings summary ===============================
tests/doc/test_rst.py::test_basic_usage
  /home/runner/work/torchjd/torchjd/.venv/lib/python3.10/site-packages/torch/nn/modules/loss.py:535: UserWarning: Using a target size (torch.Size([16, 1])) that is different to the input size (torch.Size([16])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
    return F.mse_loss(input, target, reduction=self.reduction)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== 18 passed, 1 warning in 2.86s =========================

I think this can be fixed very easily by using targets of shape (16,) instead of (16, 1)

@ValerianRey
Copy link
Contributor

Looking good! A few minor fixes to do, then we can merge.

@PierreQuinton PierreQuinton merged commit e3b3b59 into main Jun 27, 2024
10 checks passed
@PierreQuinton PierreQuinton deleted the improve_basic_usage branch June 27, 2024 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants