Class: Neuronet::InputLayer
- Inherits:
-
Array
- Object
- Array
- Neuronet::InputLayer
- Defined in:
- lib/neuronet.rb
Overview
This is the Input Layer
Instance Method Summary collapse
-
#initialize(length) ⇒ InputLayer
constructor
number of nodes.
-
#set(inputs) ⇒ Object
This is where one enters the “real world” inputs.
Constructor Details
#initialize(length) ⇒ InputLayer
number of nodes
115 116 117 118 |
# File 'lib/neuronet.rb', line 115 def initialize(length) # number of nodes super(length) 0.upto(length-1){|index| self[index] = Neuronet::Node.new } end |
Instance Method Details
#set(inputs) ⇒ Object
This is where one enters the “real world” inputs.
121 122 123 |
# File 'lib/neuronet.rb', line 121 def set(inputs) 0.upto(self.length-1){|index| self[index].value = inputs[index]} end |