MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / cal_loss

Method cal_loss

neural_network/back_propagation_neural_network.py:160–164  ·  view source on GitHub ↗
(self, ydata, ydata_)

Source from the content-addressed store, hash-verified

158 return None
159
160 def cal_loss(self, ydata, ydata_):
161 self.loss = np.sum(np.power((ydata - ydata_), 2))
162 self.loss_gradient = 2 * (ydata_ - ydata)
163 # vector (shape is the same as _ydata.shape)
164 return self.loss, self.loss_gradient
165
166 def plot_loss(self):
167 if self.ax_loss.lines:

Callers 1

trainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected