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): ...@@ -37,13 +37,9 @@ def mean_absolute_gradient(xdata, ydata, weights):
guess = np.dot(xdata,weights) guess = np.dot(xdata,weights)
samples = np.shape(guess)[0] samples = np.shape(guess)[0]
signInfo = np.sign(guess-ydata)
if np.sum(ydata-guess) < 0: gradient = np.dot(xdata.T,signInfo)/samples
gradient = xdata.sum(axis=0)/samples return gradient
else:
gradient = -xdata.sum(axis=0)/samples
return gradient.T
raise NotImplementedError raise NotImplementedError
def mean_log_cosh_loss(xdata, ydata, weights): 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