16 | %hide Data.Container.Base.Morphism.Definition.DependentLenses.(=%>)
18 | {-------------------------------------------------------------------------------
19 | This file contains the derivatives of various useful building blocks
21 | Eventually will be combined with functionality which functorially assigns these
22 | to any forward pass
24 | -------------------------------------------------------------------------------}
41 | ||| Apply a scalar lens elementwise across a tensor
53 | ||| `Tensor shape` applied to a model: one copy per entry, each with its own parameter
81 | ||| Dual to `copyN`
88 | ||| Divide by a constant, entrywise in both directions
102 | -- Activations
104 | ||| Recovers `ReLU` when `alpha=0`
105 | ||| Cannot be written as a composition of scaling and `ReLU`
126 | -- Distributions
128 | ||| Interpret a vector as logits of a distribution. The backward pass is
129 | ||| identity: gradients are computed in the sme way