class BackPropogation::ComputationalGates::DivGate
Attributes
in_frst[RW]
in_scnd[RW]
Public Class Methods
new(name)
click to toggle source
Calls superclass method
BackPropogation::ComputationalGates::CompGate::new
# File lib/ml_algorithms.rb, line 162 def initialize(name) super(name) end
Public Instance Methods
backward_pass()
click to toggle source
# File lib/ml_algorithms.rb, line 174 def backward_pass() @in_frst.bckwrd = @bckwrd * ((-1)/(@in_scnd.frwrd ** 2)) @in_scnd.bckwrd = @bckwrd * ((-1)/(@in_frst.frwrd ** 2)) end
connect(f_n,s_n)
click to toggle source
# File lib/ml_algorithms.rb, line 165 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()
click to toggle source
# File lib/ml_algorithms.rb, line 171 def forward_pass() @frwrd = @in_frst.frwrd / @in_scnd.frwrd end