Class: BackPropogation::ComputationalGates::SummGate

Inherits:
CompGate
  • Object
show all
Defined in:
lib/ml_algorithms.rb

Instance Attribute Summary collapse

Attributes inherited from CompGate

#bckwrd, #frwrd, #name, #out

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ SummGate

Returns a new instance of SummGate.



121
122
123
# File 'lib/ml_algorithms.rb', line 121

def initialize(name)
  super(name)
end

Instance Attribute Details

#in_frstObject

Returns the value of attribute in_frst.



120
121
122
# File 'lib/ml_algorithms.rb', line 120

def in_frst
  @in_frst
end

#in_scndObject

Returns the value of attribute in_scnd.



120
121
122
# File 'lib/ml_algorithms.rb', line 120

def in_scnd
  @in_scnd
end

Instance Method Details

#backward_passObject



134
135
136
137
# File 'lib/ml_algorithms.rb', line 134

def backward_pass()
  @in_frst.bckwrd = @bckwrd
  @in_scnd.bckwrd = @bckwrd
end

#connect(f_n, s_n) ⇒ Object



124
125
126
127
128
129
# File 'lib/ml_algorithms.rb', line 124

def connect(f_n,s_n)
  @in_frst = f_n
  @in_scnd = s_n
  f_n.out = self
  s_n.out = self
end

#forward_passObject



131
132
133
# File 'lib/ml_algorithms.rb', line 131

def forward_pass()
  @frwrd = @in_frst.frwrd + @in_scnd.frwrd
end