Class: BackPropogation::ComputationalGates::MultGate
- Defined in:
- lib/ml_algorithms.rb
Instance Attribute Summary collapse
-
#in_frst ⇒ Object
Returns the value of attribute in_frst.
-
#in_scnd ⇒ Object
Returns the value of attribute in_scnd.
Attributes inherited from CompGate
Instance Method Summary collapse
- #backward_pass ⇒ Object
- #connect(f_n, s_n) ⇒ Object
- #forward_pass ⇒ Object
-
#initialize(name) ⇒ MultGate
constructor
A new instance of MultGate.
Constructor Details
#initialize(name) ⇒ MultGate
Returns a new instance of MultGate.
142 143 144 |
# File 'lib/ml_algorithms.rb', line 142 def initialize(name) super(name) end |
Instance Attribute Details
#in_frst ⇒ Object
Returns the value of attribute in_frst.
141 142 143 |
# File 'lib/ml_algorithms.rb', line 141 def in_frst @in_frst end |
#in_scnd ⇒ Object
Returns the value of attribute in_scnd.
141 142 143 |
# File 'lib/ml_algorithms.rb', line 141 def in_scnd @in_scnd end |
Instance Method Details
#backward_pass ⇒ Object
154 155 156 157 |
# File 'lib/ml_algorithms.rb', line 154 def backward_pass() @in_frst.bckwrd = @bckwrd * @in_scnd.frwrd @in_scnd.bckwrd = @bckwrd * @in_frst.frwrd end |
#connect(f_n, s_n) ⇒ Object
145 146 147 148 149 150 |
# File 'lib/ml_algorithms.rb', line 145 def connect(f_n,s_n) @in_frst = f_n @in_scnd = s_n f_n.out = self s_n.out = self end |
#forward_pass ⇒ Object
151 152 153 |
# File 'lib/ml_algorithms.rb', line 151 def forward_pass() @frwrd = @in_frst.frwrd * @in_scnd.frwrd end |