This is an odd question to phrase, but here's my code:
weights[0] = weights[0] - (1 / outputY.size) * alpha * (errorDiff) * normalizedX[i][0]
weights[1] = weights[1] - (1 / outputY.size) * alpha * (errorDiff) * normalizedX[i][1]
weights[2] = weights[2] - (1 / outputY.size) * alpha * (errorDiff) * normalizedX[i][2]
Where weights and normalizedX are numpy arrays. Is there someway to do that in one line rather than repeat it? Alternatively, I could use a loop, but I'm wondering if there's a more elegant way first.
np.vectorize