class NEAT::BasicNeuronTypes::TanhNeuron

An alternative Sigmoid Function, but ranges -1 to +1

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 122
def express(instance)
  instance.define_singleton_method(@name) {|*inputs|
    tanh(2.4 * inputs.reduce {|p, q| p + q})
  }
end