def forward(self, outputs, targets):
"""MeanSquaredError forward propagation.
.. math:: L = (p - t)^2
Parameters
----------
outputs, targets : numpy.array
The arrays to compute the squared difference between.
Returns
-------
numpy.array
An expression for the element-wise squared difference.
"""
return 0.5 * np.mean(np.sum(np.power(outputs - targets, 2), axis=1))
评论列表
文章目录