Expand description
Elementwise evaluation over broadcast inputs, and its pullback. treams-rs extension.
Each input is a scalar (length one) or has the common output length, as in NumPy
broadcasting of one-dimensional arrays. The pullback turns the cotangent of each
output, the gradient of a real loss with respect to that output, into the
cotangents of the inputs. A scalar inputβs cotangent is the sum of its per-output
cotangents, added in output order on every schedule, so the thread count never
changes it.
TraitsΒ§
- Cotangent π
- The cotangent of one output element.
FunctionsΒ§
- element π
- Element
iof a scalar-or-array input of validated length. - map π
- Evaluate
fat0..sizein order, stopping at an error. - pullback π
- Pull back an elementwise evaluation with
Abroadcast complex arguments of the givenlengths. The cotangent needs one finite entry per output (otherwisemessageis returned);f(i, g)gives the argument cotangents of outputi. - pushforward π
- Apply one input direction to an elementwise evaluation. Each tangent is scalar
or has one finite entry per output;
freceives the direction at that output. - size π
- Common output length of scalar-or-array inputs: zero when an input is empty,
otherwise the longest length. Any other length is rejected with
message.