evolvio4all / evolvio4JavaScript

MIT License
10 stars 2 forks source link

Added fast_math file with approximated tanh function #25

Closed ghost closed 5 years ago

ghost commented 5 years ago

In testing this made the feedForward() method go from taking up 10% of the total time to 7% Here's a jsperf test showing a comparison Here's a graph showing the difference between the 2 functions Numbers bigger than +/-3 are clamped to +/-1

Air1N commented 5 years ago

Looks good, I had something similar before but I tested it on JSPerf and it was slower so I reverted to the built-in function.