Home
Gradient Descent 2
Steps
10000
Learn Rate
0.1
Clear
Solve
Load
Center
Farthest
Closest
Circle
Cost function:
let d2 = Math.pow(x-200, 2) + Math.pow(y-200, 2); let r2 = 100*100; Math.pow(d2 - r2, 2)
Cost grad [x,y]:
let d2 = Math.pow(x-200, 2) + Math.pow(y-200, 2); let r2 = 100*100; let g = d2 - r2; [g*(x-200), g*(y-200)]
Projection:
if(x < 0){ x = 0; } if(x > 400){ x = 400; } if(y < 0){ y = 0; } if(y > 400){ y= 400; }
Finalize: