wagenaartje / neataptic

:rocket: Blazing fast neuro-evolution & backpropagation for the browser and Node.js
https://wagenaartje.github.io/neataptic/
Other
1.18k stars 278 forks source link

Softclip activation function #156

Closed crabshank closed 3 years ago

crabshank commented 5 years ago

I have added the softclip activation function from Wikipedia, here, and it works much better for learning image filters that all the others.

SOFTCLIP:function (x,derivative){ if (derivative) return ((Math.exp(1) - 1)*Math.exp(x))/((Math.exp(x) + Math.exp(1))*(1 + Math.exp(x))); return Math.log ((1+Math.exp(x))/(1+Math.exp(x-1))); }

Can you add it? P.S. sorry to put it here, but the pull requests page was acting weird.