@@ -8,10 +8,11 @@ full API, see [torchjd.org](https://torchjd.org/latest/docs/scalarization/).
88
99## The abstraction
1010
11- A scalarizer captures a single decision: ** how to collapse a vector of objective values into one
12- scalar to minimize** , using only those values. It is the value-level counterpart of an aggregator,
13- which makes the same kind of decision at the gradient level. Everything after it (backpropagation,
14- the optimizer step) is standard PyTorch.
11+ A scalarizer captures a single decision: ** how to collapse a vector of values into one scalar to
12+ minimize** . It operates purely on those values: it has no notion of the losses, tasks, or model they
13+ come from, which is why its input is named ` values ` and not ` losses ` . It is the value-level
14+ counterpart of an aggregator, which makes the same decision at the gradient level. Everything after
15+ it (backpropagation, the optimizer step) is standard PyTorch.
1516
1617Concretely, it subclasses ` Scalarizer ` (in [ ` _scalarizer_base.py ` ] ( _scalarizer_base.py ) ) and
1718implements one method:
@@ -21,9 +22,8 @@ def forward(self, values: Tensor, /) -> Tensor:
2122 ...
2223```
2324
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.
25+ - ** Any shape in, scalar out:** it reduces over * all* elements of ` values ` (scalar, vector, matrix,
26+ higher-dim) into a single scalar.
2727- ** Pure and differentiable:** the output depends only on ` values ` and the configured parameters, so
2828 that ` scalarizer(values).backward() ` produces the gradient.
2929
0 commit comments