DrewSimtech / optimizer

for plotting convergance
0 stars 0 forks source link

Fix gradient magnitude calculations #17

Closed DrewSimtech closed 6 years ago

DrewSimtech commented 6 years ago

As a developer I would like the tool to use the proper calculations for deciding the gradient magnitude. To calculate a gradient magnitude use the following formula: ||v|| = sqrt(x^2 + y^2 + ... + n^2) where n is the number of components in the vector.

DrewSimtech commented 6 years ago

For sake of readability I used sqrt(v) instead of comparing it against epsilon^2 which would be faster.