Module broadcast

Module broadcast 

Source
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 i of a scalar-or-array input of validated length.
map πŸ”’
Evaluate f at 0..size in order, stopping at an error.
pullback πŸ”’
Pull back an elementwise evaluation with A broadcast complex arguments of the given lengths. The cotangent needs one finite entry per output (otherwise message is returned); f(i, g) gives the argument cotangents of output i.
pushforward πŸ”’
Apply one input direction to an elementwise evaluation. Each tangent is scalar or has one finite entry per output; f receives 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.