class NEAT::BasicNeuronTypes::CosineNeuron

Cosine function (CPPN) – adjusted to have its +1 and -1 near TanhNeuron

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