Commit 4948f373 authored by SHREYANSH JAIN's avatar SHREYANSH JAIN

corrected absolute error

parent f7409d2a
This diff is collapsed.
This diff is collapsed.
......@@ -37,13 +37,9 @@ def mean_absolute_gradient(xdata, ydata, weights):
guess = np.dot(xdata,weights)
samples = np.shape(guess)[0]
if np.sum(ydata-guess) < 0:
gradient = xdata.sum(axis=0)/samples
else:
gradient = -xdata.sum(axis=0)/samples
return gradient.T
signInfo = np.sign(guess-ydata)
gradient = np.dot(xdata.T,signInfo)/samples
return gradient
raise NotImplementedError
def mean_log_cosh_loss(xdata, ydata, weights):
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment