Spaces:
Running
Download frontends/react/src/usage.md from nhamid289/optimization-dev: direct link, hf CLI and curl.
- Browser
- Download file 1.98 kB
-
https://huggingface.co/spaces/nhamid289/optimization-dev/resolve/main/frontends/react/src/usage.md
- Command line
-
hf download hf://spaces/nhamid289/optimization-dev/frontends/react/src/usage.md
-
curl -L -o usage.md https://huggingface.co/spaces/nhamid289/optimization-dev/resolve/main/frontends/react/src/usage.md
Watch an optimiser walk downhill on a function you choose, one iteration at a time.
Steps
- Function (Configure tab): pick a univariate f(x) or bivariate f(x, y) function from the list, or type your own in the box, e.g.
x^4 - 2x^2 + 0.3xorsin(x) cos(y). A function that usesyhas two variables. You can usesin,cos,tan,asin,acos,atan,exp,log(orln),sqrt,abs,piande;2xmeans2*x. - Optimiser: pick an algorithm and change its settings in the boxes below it, e.g. η, the learning rate. Hover over a box for its name, or press ⓘ for every setting with a description. The reset arrow beside it puts the settings back to their defaults.
- Initial point: type it, click on the plot, or press the dice for a random one. The reset arrow beside it goes back to the function's usual initial point.
- Step (bottom of the panel, in every tab): press Play, or step forward and back. Type a number in the × box to move several iterations per step; each one is shown in turn.
The Metrics tab shows the current point with f, the gradient and the Hessian (or f′ and f″ with one variable), and a chart of f at each iteration. A run stops after 1000 iterations, or earlier if it diverges.
Two variables
The plot is a contour map of f, coloured from low (purple) to high (yellow). Tick Gradient field to draw ∇f as arrows (contour only); they point uphill, so the optimiser moves against them. Surface shows f in 3D; drag to turn it.
Compare
In the Compare tab, press + Add optimiser for another run on the same function. Click a run to open it and change its algorithm, settings and initial point; every run steps together, from the start again after a change. Click a run's colour to pick another, or × to remove it. Run 1 is the main run from Configure: editing it here changes it there too.
Plot
Drag to pan and scroll to zoom. The function is redrawn for the new view.