silky / ideas

:bulb: various ideas
https://github.com/silky/ideas/issues
MIT License
20 stars 2 forks source link

activation function composer #398

Open silky opened 6 years ago

silky commented 6 years ago

or more generally, a function composer

  1. what does the graph of relu look like?
  2. what about the graph of relu . tanh ?

and so on, indefinitely and arbitrarily.

some features:

silky commented 6 years ago

using hoe and plot

hoe 'map (tanh . (\x -> (x - 500)/50)) [0..1000]' | plot
hoe 'map (tanh . tanh . (\x -> (x - 500)/50)) [0..1000]' | plot
hoe 'map ((\r -> if r > 0 r else 0) . tanh . (\x -> (x - 500)/50)) [0..1000]' | plot
hoe 'map ((\r -> if r > 0 then r else 0) . tanh . (\x -> (x - 500)/50)) [0..1000]' | plot
hoe 'map (tanh . (\r -> if r > 0 then r else 0) . tanh . (\x -> (x - 500)/50)) [0..1000]' | plot
hoe 'map (tanh . (\r -> if r > 0 then r else 0) . tanh . tanh . (\x -> (x - 500)/50)) [0..1000]' | plot
hoe 'map (tanh . (\r -> if r > 0 then r else 0) . tanh . sinh . (\x -> (x - 500)/50)) [0..1000]' | plot
hoe 'map (tanh . (\r -> if r > 0 then r else 0) . tanh . (\s -> exp s / (exp s + 1)) . (\x -> (x - 500)/50)) [0..1000]' | plot