Class: NEAT::BasicNeuronTypes::SineNeuron
- Defined in:
- lib/rubyneat/neuron.rb
Overview
Sin function (CPPN) – adjusted to have its +1 and -1 near TanhNeuron
Instance Attribute Summary
Attributes inherited from Neuron
#genotype, #heirarchy_number, #output, #trait
Attributes inherited from NeatOb
Instance Method Summary collapse
-
#express(instance) ⇒ Object
create a function on the instance with our name that sums all inputs and produce a sigmoid output (using tanh).
Methods inherited from Neuron
#bias?, bias?, inherited, input?, #input?, neuron_types, #output?, type_name
Methods included from Graph
#<<, #add, #clear_graph, #inputs
Methods inherited from NeatOb
attr_neat, #initialize, log, #log, #to_s
Constructor Details
This class inherits a constructor from NEAT::NeatOb
Instance Method Details
#express(instance) ⇒ Object
create a function on the instance with our name that sums all inputs and produce a sigmoid output (using tanh)
138 139 140 141 142 |
# File 'lib/rubyneat/neuron.rb', line 138 def express(instance) instance.define_singleton_method(@name) {|*inputs| sin(1.6 * inputs.reduce {|p, q| p + q}) } end |