Source/Packages

Component.CubicTanhGateSigmoid

packages/components/src/Component/CubicTanhGateSigmoid.alpha

179 lines15 declarations6.9 KiBSHA-256 d73f403dc6e0

def · lines 62–87

propagateCubicTanhSigmoidGateWith

Full file
62def propagateCubicTanhSigmoidGateWith =
63  (lambda unrestricted operations : Float32Operations .
64    unrestricted x : Nat .
65    unrestricted upstream : Nat .
66    let unrestricted s =
67      (sigmoidFromExp2With operations (cubicTanhSigmoidArgumentWith operations x))
68      in
69      let unrestricted complement =
70        (f32Add operations sigmoidWeightedGateOne (f32Negate operations s))
71        in
72        let unrestricted slope =
73          (f32Add
74            operations
75            cubicTanhSigmoidScale
76            (f32Multiply operations cubicTanhSigmoidSlopeCubic (f32Multiply operations x x)))
77          in
78          f32Multiply
79            operations
80            upstream
81            (f32Add
82              operations
83              s
84              (f32Multiply
85                operations
86                (f32Multiply operations x (f32Multiply operations s complement))
87                slope)))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.