Class: NEAT::BasicNeuronTypes::BiasNeuron
- Inherits:
-
InputNeuron
- Object
- NeatOb
- Neuron
- InputNeuron
- NEAT::BasicNeuronTypes::BiasNeuron
- Defined in:
- lib/rubyneat/neuron.rb
Overview
Special class of neuron that provides a bias signal.
FIXME: The bias value is not behaving as expected because FIXME: the instance is not the neuron, but the phenotype.
Instance Attribute Summary collapse
-
#neu_bias ⇒ Object
Returns the value of attribute neu_bias.
Attributes inherited from Neuron
#genotype, #heirarchy_number, #output, #trait
Attributes inherited from NeatOb
Class Method Summary collapse
Instance Method Summary collapse
-
#express(instance) ⇒ Object
Just provides a bias signal FIXME: we had to hard-code the value here for now.
-
#initialize(c = nil, n = nil) ⇒ BiasNeuron
constructor
A new instance of BiasNeuron.
Methods inherited from InputNeuron
Methods inherited from Neuron
#bias?, inherited, input?, #input?, neuron_types, #output?, type_name
Methods included from Graph
#<<, #add, #clear_graph, #inputs
Methods inherited from NeatOb
Constructor Details
#initialize(c = nil, n = nil) ⇒ BiasNeuron
Returns a new instance of BiasNeuron.
98 99 100 101 |
# File 'lib/rubyneat/neuron.rb', line 98 def initialize(c=nil, n=nil) super @neu_bias = 1.00 end |
Instance Attribute Details
#neu_bias ⇒ Object
Returns the value of attribute neu_bias.
96 97 98 |
# File 'lib/rubyneat/neuron.rb', line 96 def neu_bias @neu_bias end |
Class Method Details
.bias? ⇒ Boolean
95 |
# File 'lib/rubyneat/neuron.rb', line 95 def self.bias? ; true ; end |
Instance Method Details
#express(instance) ⇒ Object
Just provides a bias signal FIXME: we had to hard-code the value here for now. Not a biggie, FIXME: but really should be @neu_bias
106 107 108 |
# File 'lib/rubyneat/neuron.rb', line 106 def express(instance) instance.define_singleton_method(@name) { 1.00 } end |