class NEAT::BasicNeuronTypes::SigmoidNeuron
The most commonly-used neuron for the hidden and output layers. We use the Logistic Function for the Sigmoid.
Public Instance Methods
express(instance)
click to toggle source
create a function on the instance with our name that sums all inputs and produce a sigmoid output (using tanh)
# File lib/rubyneat/neuron.rb, line 111 def express(instance) instance.define_singleton_method(@name) {|*inputs| 1.0 / (1.0 + exp(-4.9 * inputs.reduce {|p, q| p + q})) } end