Class: RubyBrain::Nodes::ConstNode

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_brain/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value = 1.0) ⇒ ConstNode

Returns a new instance of ConstNode.



45
46
47
48
# File 'lib/ruby_brain/nodes.rb', line 45

def initialize(value=1.0)
  @value = value
  @this_output = nil
end

Instance Attribute Details

#left_side_weightsObject

Returns the value of attribute left_side_weights.



42
43
44
# File 'lib/ruby_brain/nodes.rb', line 42

def left_side_weights
  @left_side_weights
end

#order_indexObject

Returns the value of attribute order_index.



42
43
44
# File 'lib/ruby_brain/nodes.rb', line 42

def order_index
  @order_index
end

#right_side_weightsObject

Returns the value of attribute right_side_weights.



42
43
44
# File 'lib/ruby_brain/nodes.rb', line 42

def right_side_weights
  @right_side_weights
end

#this_backward_outputObject (readonly)

Returns the value of attribute this_backward_output.



43
44
45
# File 'lib/ruby_brain/nodes.rb', line 43

def this_backward_output
  @this_backward_output
end

#this_outputObject (readonly)

Returns the value of attribute this_output.



43
44
45
# File 'lib/ruby_brain/nodes.rb', line 43

def this_output
  @this_output
end

#valueObject

Returns the value of attribute value.



42
43
44
# File 'lib/ruby_brain/nodes.rb', line 42

def value
  @value
end

Instance Method Details

#output_of_backward_calc(backward_inputs = []) ⇒ Object



54
55
56
# File 'lib/ruby_brain/nodes.rb', line 54

def output_of_backward_calc(backward_inputs=[])
  nil
end

#output_of_forward_calc(inputs = []) ⇒ Object



50
51
52
# File 'lib/ruby_brain/nodes.rb', line 50

def output_of_forward_calc(inputs=[])
  @this_output = @value
end