You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the way to implement fast sigmoid would be:
var x =randomTensor([1000, 1000], 1.0)
var output =newTensor[float64](x.shape)
forEach o in output, xi in x:
o =1/ (1+exp(-x))
which is quite wordy.
Reusing the Arraymancer syntax for broacasting would be:
let output =1./ (1.+exp(-x))
but this would allocate for:
x0 = -x
x1 = exp(x0)
x2 = 1 .+ x1
x3 = 1/x2
Unfortunately we cannot use anything over than `=` in a let/var statement like `let x .= 1 / (1 + exp(-x))`
But we can use `let x = fuse: 1 / (1 + exp(-x))` to request the code to generate `forEach` automatically.
The text was updated successfully, but these errors were encountered:
Currently the way to implement fast sigmoid would be:
which is quite wordy.
Reusing the Arraymancer syntax for broacasting would be:
but this would allocate for:
The text was updated successfully, but these errors were encountered: