tensor-compiler / taco

The Tensor Algebra Compiler (taco) computes sparse tensor expressions on CPUs and GPUs
http://tensor-compiler.org
Other
1.23k stars 185 forks source link

[help] sigmoid on vector #227

Closed ClmnsRck closed 3 years ago

ClmnsRck commented 5 years ago

I would like to implement a Feed-Formward-iteration using taco. For that i need the sigmoid function:a = 1/(1 + e^(-x))

Can i implement this using tacos Index and code generation?

ClmnsRck commented 5 years ago

using the cmath exp() function gives me this error:

 error: no matching function for call to ‘exp(taco::IndexExpr)’
     h1_out(h1_o) = (T)1/((T)1 + exp((-1)*h1_in(h1_o)) );