Hi Sam!



 Sam_Lerman:

Is there no simple function equivalent to Pytorch’s implementation you could provide


erf() is a so-called special function.  It is well studied, well
understood, and (reasonably) easy to calculate with modern
numerical analysis techniques.
But there is no “simple function equivalent” to it (other than erf()
or things like the integral used to define it).  So erf() is the best
you’ve got.


http://www.matrixcalculus.org
it would be convenient if I could just enter the full formula into that tool above.


If you want to “compute a derivative by hand,” that’s easy, because
the derivative of erf() is an elementary function, namely the
normal distribution.
My pocket calculator doesn’t know how anything about erf(), so
there’s no practical way for me to calculate erf() with my calculator.
But python does know about erf(), so math.erf (1.234) works
just fine in python.
If the calculus tool you linked to knows about erf(), then you should
be good.  If it doesn’t, you’ll have to “compute a derivative by hand”
(or switch to a better calculus tool).
Best.
K. Frank