Class: Neuronet::InputLayer
- Inherits:
-
Array
- Object
- Array
- Neuronet::InputLayer
- Defined in:
- lib/neuronet.rb
Overview
Neuronet::InputLayer is an Array of Neuronet::Node’s. It can be used for the input layer of a feed forward network.
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
174 175 176 177 |
# File 'lib/neuronet.rb', line 174 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.
180 181 182 |
# File 'lib/neuronet.rb', line 180 def set(inputs) 0.upto(self.length-1){|index| self[index].value = inputs[index]} end |