Class: Neuronet::Node
- Inherits:
-
Object
- Object
- Neuronet::Node
- Defined in:
- lib/neuronet.rb
Overview
In Neuronet, there are two main types of objects: Nodes and Connections. A Node has a value which the implementation can set. A plain Node instance is used primarily as input neurons, and its value is not changed by training. It is a terminal for backpropagation of errors. Nodes are used for the input layer.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#activation ⇒ Object
(also: #update)
readonly
Returns the value of attribute activation.
Instance Method Summary collapse
-
#backpropagate(error) ⇒ Object
Node is a terminal where backpropagation ends.
-
#initialize(val = 0.0) ⇒ Node
constructor
A new instance of Node.
-
#value ⇒ Object
The “real world” value is stored as a squashed activation.
-
#value=(val) ⇒ Object
The “real world” value of a node is the value of it’s activation unsquashed.
Constructor Details
#initialize(val = 0.0) ⇒ Node
Returns a new instance of Node.
59 60 61 |
# File 'lib/neuronet.rb', line 59 def initialize(val=0.0) self.value = val end |
Instance Attribute Details
#activation ⇒ Object (readonly) Also known as: update
Returns the value of attribute activation.
50 51 52 |
# File 'lib/neuronet.rb', line 50 def activation @activation end |
Instance Method Details
#backpropagate(error) ⇒ Object
Node is a terminal where backpropagation ends.
69 70 71 72 |
# File 'lib/neuronet.rb', line 69 def backpropagate(error) # to be over-ridden nil end |