Skip to content

Commit 42f6bcf

Browse files
committed
add readme v3
2 parents 5990d23 + ada66ad commit 42f6bcf

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

src/torchjd/scalarization/README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,11 @@ def forward(self, values: Tensor, /) -> Tensor:
2121
...
2222
```
2323

24-
- It reduces over *all* elements of `values`, of any shape, into a 0-dim scalar.
25-
- The result is a **differentiable** function of `values` and the configured parameters, so that
26-
`scalarizer(values).backward()` produces the gradient.
27-
28-
## What is not a scalarizer
29-
30-
A scalarizer sees only the values. Its gradient-level counterpart lives in the
31-
[aggregation](../aggregation) package: an `Aggregator` (which, like a scalarizer, can be stateful)
32-
combines the per-objective *gradients* (the Jacobian or its Gramian) into a single gradient.
33-
34-
So if your method needs the model, its parameters, or the per-objective gradients (gradient norms,
35-
for instance), it is an aggregator, not a scalarizer.
24+
- **Any shape in, scalar out:** it reduces over *all* dimensions of `values` (scalar, vector, matrix,
25+
etc...) into a scalar.
26+
- **`values`, not `losses`:** a scalarizer is generic and not tied to losses.
27+
- **Pure and differentiable:** the output depends only on `values` and the configured parameters, so
28+
that `scalarizer(values).backward()` produces the gradient.
3629

3730
## Adding one
3831

0 commit comments

Comments
 (0)