Joel Woodfield commited on
Commit
0383d82
·
1 Parent(s): 0bd8c78

Fix bug in Adadelta

Browse files
backend/src/optimization_logic.py CHANGED
@@ -456,7 +456,6 @@ def rmsprop_bivariate(
456
  def adadelta_univariate(
457
  function: Expr,
458
  x0: float,
459
- learning_rate: float,
460
  beta: float,
461
  epsilon: float,
462
  steps: int,
@@ -498,7 +497,6 @@ def adadelta_bivariate(
498
  function: Expr,
499
  x0: float,
500
  y0: float,
501
- learning_rate: float,
502
  beta: float,
503
  epsilon: float,
504
  steps: int,
 
456
  def adadelta_univariate(
457
  function: Expr,
458
  x0: float,
 
459
  beta: float,
460
  epsilon: float,
461
  steps: int,
 
497
  function: Expr,
498
  x0: float,
499
  y0: float,
 
500
  beta: float,
501
  epsilon: float,
502
  steps: int,
dist/assets/{index-BqVICm9j.js → index-BoSq-s5V.js} RENAMED
@@ -3843,4 +3843,4 @@ The plot is interactive:
3843
  - Click and drag to pan
3844
  - Scroll to zoom
3845
  - In bivariate mode, click **Update color scale** to rescale the heatmap so that the currently visible minimum and maximum values define the color range
3846
- `,ij={"Gradient Descent":{learningRate:"0.1",momentum:"0.0"},Nesterov:{learningRate:"0.1",momentum:"0.0"},Adam:{learningRate:"0.1",beta1:"0.9",beta2:"0.999",epsilon:"1e-8"},Adagrad:{learningRate:"0.1",epsilon:"1e-8"},RMSProp:{learningRate:"0.1",beta:"0.9",epsilon:"1e-8"},Adadelta:{beta:"0.9",epsilon:"1e-8"},Newton:{}},$6={"--Custom--":"x^2",Quadratic:"x^2","Local Minima":"x^2 - 0.1cos(20x)",Plateau:"x^4"},J6={"--Custom--":"x^2 + 3y^2",Quadratic:"x^2 + 3y^2",Small:"(0.05x)^2 + 3(0.05y)^2",Ackley:"-20exp(-0.2 sqrt(0.5(x^2 + y^2))) - exp(0.5(cos(2 pi x) + cos(2 pi y))) + e + 20",Rasteringin:"20 + (x^2 - 10cos(2 pi x)) + (y^2 - 10cos(2 pi y))",Rosenbrock:"(1 - x)^2 + 100(y - x^2)^2"};function oj({settings:Ie,setSettings:ht,onRandomInitialPoint:St,trajectoryValues:wt,onReset:lr,onNextStep:vr,onPrevStep:Lr}){const rn=["Settings","Optimize","Usage"],[xn,$r]=up.useState("Settings");function Tn(Ri,Ts){if(Ri==="algorithm"){const Si=ij[Ts];ht({...Ie,algorithm:Ts,...Si})}else ht({...Ie,[Ri]:Ts})}const[zn,xa]=up.useState("--Custom--");function Jn(Ri){xa(Ri);const Ts=Ie.mode==="Bivariate"?J6[Ri]:$6[Ri];Tn("functionExpr",Ts)}function ho(Ri){const Ts="--Custom--",Si=Ri==="Bivariate"?J6[Ts]:$6[Ts];ht({...Ie,mode:Ri,functionExpr:Si}),xa(Ts)}function Mo(Ri){return Ri&&Ri.length>0?Ri[Ri.length-1]:null}const is=Mo(wt?.x),Pi=Mo(wt?.y),Ge=Mo(wt?.derivative),ko=Mo(wt?.secondDerivative),Ml=Mo(wt?.z),xo=Mo(wt?.gradient),li=Mo(wt?.hessian);return Ro.jsxs(eM,{className:"flex flex-col h-full p-4 gap-2 min-w-0 min-h-0 overflow-auto",children:[Ro.jsx(DO,{tabs:rn,activeTab:xn,onChange:$r}),Ro.jsxs("div",{className:"flex flex-col gap-4 min-h-0 min-w-0 overflow-auto",children:[xn==="Settings"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsx(IO,{label:"Problem Type",options:rj,activeOption:Ie.mode,onChange:ho}),Ro.jsx(m8,{label:"Function",options:Ie.mode==="Bivariate"?Object.keys(J6):Object.keys($6),activeOption:zn,onChange:Jn}),Ro.jsx(pd,{label:"Function Expression",value:Ie.functionExpr,onChange:Ri=>Tn("functionExpr",Ri),readonly:zn!=="--Custom--",rows:3}),Ro.jsx(m8,{label:"Algorithm",options:nj,activeOption:Ie.algorithm,onChange:Ri=>Tn("algorithm",Ri)}),Ro.jsxs("div",{className:`${Ie.mode==="Bivariate"?"grid grid-cols-2 gap-2":""}`,children:[Ro.jsx(pd,{label:"Initial X",value:Ie.x0,onChange:Ri=>Tn("x0",Ri)}),Ie.mode==="Bivariate"&&Ro.jsx(pd,{label:"Initial Y",value:Ie.y0||"",onChange:Ri=>Tn("y0",Ri)})]}),Ro.jsx(ST,{label:"Random Initial Point",onClick:St}),Ro.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[["Gradient Descent","Nesterov","Adam","Adagrad","RMSProp","Adadelta"].includes(Ie.algorithm)&&Ro.jsx(Ro.Fragment,{children:Ro.jsx(pd,{label:"Learning Rate",value:Ie.learningRate,onChange:Ri=>Tn("learningRate",Ri)})}),["Gradient Descent","Nesterov"].includes(Ie.algorithm)&&Ro.jsx(Ro.Fragment,{children:Ro.jsx(pd,{label:"Momentum",value:Ie.momentum,onChange:Ri=>Tn("momentum",Ri)})}),Ie.algorithm==="Adam"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsx(pd,{label:"Beta 1",value:Ie.beta1,onChange:Ri=>Tn("beta1",Ri)}),Ro.jsx(pd,{label:"Beta 2",value:Ie.beta2,onChange:Ri=>Tn("beta2",Ri)})]}),["RMSProp","Adadelta"].includes(Ie.algorithm)&&Ro.jsx(Ro.Fragment,{children:Ro.jsx(pd,{label:"Beta",value:Ie.beta,onChange:Ri=>Tn("beta",Ri)})}),["Adam","Adagrad","RMSProp","Adadelta"].includes(Ie.algorithm)&&Ro.jsx(Ro.Fragment,{children:Ro.jsx(pd,{label:"Epsilon",value:Ie.epsilon,onChange:Ri=>Tn("epsilon",Ri)})})]})]}),xn==="Optimize"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsxs("div",{className:"hidden lg:flex flex-col gap-4 min-h-0 min-w-0 overflow-auto",children:[Ie.mode==="Univariate"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsx(pd,{label:"Current X",value:is!==null?is.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Y",value:Pi!==null?Pi.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Derivative",value:Ge!==null?Ge.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Second Derivative",value:ko!==null?ko.toFixed(4):"",readonly:!0})]}),Ie.mode==="Bivariate"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsx(pd,{label:"Current X",value:is!==null?is.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Y",value:Pi!==null?Pi.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Z",value:Ml!==null?Ml.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Gradient",value:xo!==null?`[${xo.map(Ri=>Ri.toFixed(4)).join(", ")}]`:"",readonly:!0}),Ro.jsx(pd,{label:"Current Hessian",value:li!==null?`[${li.map(Ri=>`[${Ri.map(Ts=>Ts.toFixed(4)).join(", ")}]`).join(", ")}]`:"",readonly:!0})]})]}),Ro.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[Ro.jsx(ST,{label:"Next Step",onClick:vr}),Ro.jsx(ST,{label:"Previous Step",onClick:Lr})]}),Ro.jsx(ST,{label:"Reset",onClick:lr})]}),xn==="Usage"&&Ro.jsx($U,{components:{h1:({children:Ri})=>Ro.jsx("h1",{className:"text-2xl font-bold mt-4 mb-2",children:Ri}),h2:({children:Ri})=>Ro.jsx("h2",{className:"text-xl font-semibold mt-4 mb-2",children:Ri}),h3:({children:Ri})=>Ro.jsx("h3",{className:"text-lg font-semibold mt-4 mb-2",children:Ri}),p:({children:Ri})=>Ro.jsx("p",{className:"leading-6 mb-3 last:mb-0",children:Ri}),ul:({children:Ri})=>Ro.jsx("ul",{className:"list-disc pl-5 mb-3",children:Ri}),ol:({children:Ri})=>Ro.jsx("ol",{className:"list-decimal pl-5 mb-3",children:Ri}),li:({children:Ri})=>Ro.jsx("li",{className:"mb-1",children:Ri})},children:aj})]})]})}function sj(Ie){return new Worker("/assets/pyodide.worker-BFXTvOBt.js",{name:Ie?.name})}function lj(Ie){const[ht,St]=up.useState({}),[wt,lr]=up.useState(!0),vr=up.useRef(null);function Lr(Tn){vr.current&&vr.current.postMessage({type:"INIT",settings:Tn})}function rn(){vr.current&&vr.current.postMessage({type:"NEXT_STEP"})}function xn(){vr.current&&vr.current.postMessage({type:"PREV_STEP"})}function $r(){vr.current&&vr.current.postMessage({type:"RESET"})}return up.useEffect(()=>{const Tn=new sj;return vr.current=Tn,Tn.onmessage=zn=>{const xa=zn.data;xa.type==="READY"?(console.log("Pyodide is ready"),lr(!1),Lr(Ie)):xa.type==="RESULT"&&St(Jn=>({functionValues:xa.data.functionValues||Jn.functionValues,trajectoryValues:xa.data.trajectoryValues||Jn.trajectoryValues}))},()=>{Tn.terminate()}},[]),{isLoading:wt,plotData:ht,sendInit:Lr,sendReset:$r,sendNextStep:rn,sendPrevStep:xn}}const uj={mode:"Univariate",functionExpr:"x^2",algorithm:"Gradient Descent",x0:"0.5",y0:"0.5",learningRate:"0.1",momentum:"0.0"},cj=[-1,1],fj=[-1,1];function hj(){const[Ie,ht]=up.useState(uj),St=up.useRef(cj),wt=up.useRef(fj),lr={...Ie,xlim:St.current,ylim:wt.current};function vr($r){ht($r),xn.sendInit({...$r,xlim:St.current,ylim:wt.current})}function Lr($r,Tn){St.current=$r,wt.current=Tn,xn.sendInit({...Ie,xlim:$r,ylim:Tn})}function rn(){const $r=St.current[1]-St.current[0],Tn=wt.current[1]-wt.current[0],zn=(St.current[0]+Math.random()*$r*.95).toFixed(2),xa=(wt.current[0]+Math.random()*Tn*.95).toFixed(2),Jn={...Ie,x0:zn,y0:xa};vr(Jn)}const xn=lj(lr);return Ro.jsxs("div",{className:"grid grid-cols-[1fr_12fr_1fr] lg:h-dvh bg-stone-50",children:[Ro.jsx("div",{}),Ro.jsxs("div",{className:"flex flex-col gap-6 p-6 min-h-0",children:[Ro.jsx("div",{className:"title",children:"Optimization Trajectory Visualizer"}),Ro.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] gap-12 flex-1 min-h-0 overflow-auto",children:[Ro.jsx(zO,{data:xn.plotData,isLoading:xn.isLoading,xlim:St.current,ylim:wt.current,setAxisLimits:Lr}),Ro.jsx(oj,{settings:Ie,setSettings:vr,onRandomInitialPoint:rn,trajectoryValues:xn.plotData.trajectoryValues,onReset:()=>xn.sendReset(),onNextStep:()=>xn.sendNextStep(),onPrevStep:()=>xn.sendPrevStep()})]})]}),Ro.jsx("div",{})]})}AO.createRoot(document.getElementById("root")).render(Ro.jsx(up.StrictMode,{children:Ro.jsx(hj,{})}));
 
3843
  - Click and drag to pan
3844
  - Scroll to zoom
3845
  - In bivariate mode, click **Update color scale** to rescale the heatmap so that the currently visible minimum and maximum values define the color range
3846
+ `,ij={"Gradient Descent":{learningRate:"0.1",momentum:"0.0"},Nesterov:{learningRate:"0.1",momentum:"0.0"},Adam:{learningRate:"0.1",beta1:"0.9",beta2:"0.999",epsilon:"1e-8"},Adagrad:{learningRate:"0.1",epsilon:"1e-8"},RMSProp:{learningRate:"0.1",beta:"0.9",epsilon:"1e-8"},Adadelta:{beta:"0.9",epsilon:"1e-3"},Newton:{}},$6={"--Custom--":"x^2",Quadratic:"x^2","Local Minima":"x^2 - 0.1cos(20x)",Plateau:"x^4"},J6={"--Custom--":"x^2 + 3y^2",Quadratic:"x^2 + 3y^2",Small:"(0.05x)^2 + 3(0.05y)^2",Ackley:"-20exp(-0.2 sqrt(0.5(x^2 + y^2))) - exp(0.5(cos(2 pi x) + cos(2 pi y))) + e + 20",Rasteringin:"20 + (x^2 - 10cos(2 pi x)) + (y^2 - 10cos(2 pi y))",Rosenbrock:"(1 - x)^2 + 100(y - x^2)^2"};function oj({settings:Ie,setSettings:ht,onRandomInitialPoint:St,trajectoryValues:wt,onReset:lr,onNextStep:vr,onPrevStep:Lr}){const rn=["Settings","Optimize","Usage"],[xn,$r]=up.useState("Settings");function Tn(Ri,Ts){if(Ri==="algorithm"){const Si=ij[Ts];ht({...Ie,algorithm:Ts,...Si})}else ht({...Ie,[Ri]:Ts})}const[zn,xa]=up.useState("--Custom--");function Jn(Ri){xa(Ri);const Ts=Ie.mode==="Bivariate"?J6[Ri]:$6[Ri];Tn("functionExpr",Ts)}function ho(Ri){const Ts="--Custom--",Si=Ri==="Bivariate"?J6[Ts]:$6[Ts];ht({...Ie,mode:Ri,functionExpr:Si}),xa(Ts)}function Mo(Ri){return Ri&&Ri.length>0?Ri[Ri.length-1]:null}const is=Mo(wt?.x),Pi=Mo(wt?.y),Ge=Mo(wt?.derivative),ko=Mo(wt?.secondDerivative),Ml=Mo(wt?.z),xo=Mo(wt?.gradient),li=Mo(wt?.hessian);return Ro.jsxs(eM,{className:"flex flex-col h-full p-4 gap-2 min-w-0 min-h-0 overflow-auto",children:[Ro.jsx(DO,{tabs:rn,activeTab:xn,onChange:$r}),Ro.jsxs("div",{className:"flex flex-col gap-4 min-h-0 min-w-0 overflow-auto",children:[xn==="Settings"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsx(IO,{label:"Problem Type",options:rj,activeOption:Ie.mode,onChange:ho}),Ro.jsx(m8,{label:"Function",options:Ie.mode==="Bivariate"?Object.keys(J6):Object.keys($6),activeOption:zn,onChange:Jn}),Ro.jsx(pd,{label:"Function Expression",value:Ie.functionExpr,onChange:Ri=>Tn("functionExpr",Ri),readonly:zn!=="--Custom--",rows:3}),Ro.jsx(m8,{label:"Algorithm",options:nj,activeOption:Ie.algorithm,onChange:Ri=>Tn("algorithm",Ri)}),Ro.jsxs("div",{className:`${Ie.mode==="Bivariate"?"grid grid-cols-2 gap-2":""}`,children:[Ro.jsx(pd,{label:"Initial X",value:Ie.x0,onChange:Ri=>Tn("x0",Ri)}),Ie.mode==="Bivariate"&&Ro.jsx(pd,{label:"Initial Y",value:Ie.y0||"",onChange:Ri=>Tn("y0",Ri)})]}),Ro.jsx(ST,{label:"Random Initial Point",onClick:St}),Ro.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[["Gradient Descent","Nesterov","Adam","Adagrad","RMSProp","Adadelta"].includes(Ie.algorithm)&&Ro.jsx(Ro.Fragment,{children:Ro.jsx(pd,{label:"Learning Rate",value:Ie.learningRate,onChange:Ri=>Tn("learningRate",Ri)})}),["Gradient Descent","Nesterov"].includes(Ie.algorithm)&&Ro.jsx(Ro.Fragment,{children:Ro.jsx(pd,{label:"Momentum",value:Ie.momentum,onChange:Ri=>Tn("momentum",Ri)})}),Ie.algorithm==="Adam"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsx(pd,{label:"Beta 1",value:Ie.beta1,onChange:Ri=>Tn("beta1",Ri)}),Ro.jsx(pd,{label:"Beta 2",value:Ie.beta2,onChange:Ri=>Tn("beta2",Ri)})]}),["RMSProp","Adadelta"].includes(Ie.algorithm)&&Ro.jsx(Ro.Fragment,{children:Ro.jsx(pd,{label:"Beta",value:Ie.beta,onChange:Ri=>Tn("beta",Ri)})}),["Adam","Adagrad","RMSProp","Adadelta"].includes(Ie.algorithm)&&Ro.jsx(Ro.Fragment,{children:Ro.jsx(pd,{label:"Epsilon",value:Ie.epsilon,onChange:Ri=>Tn("epsilon",Ri)})})]})]}),xn==="Optimize"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsxs("div",{className:"hidden lg:flex flex-col gap-4 min-h-0 min-w-0 overflow-auto",children:[Ie.mode==="Univariate"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsx(pd,{label:"Current X",value:is!==null?is.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Y",value:Pi!==null?Pi.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Derivative",value:Ge!==null?Ge.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Second Derivative",value:ko!==null?ko.toFixed(4):"",readonly:!0})]}),Ie.mode==="Bivariate"&&Ro.jsxs(Ro.Fragment,{children:[Ro.jsx(pd,{label:"Current X",value:is!==null?is.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Y",value:Pi!==null?Pi.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Z",value:Ml!==null?Ml.toFixed(4):"",readonly:!0}),Ro.jsx(pd,{label:"Current Gradient",value:xo!==null?`[${xo.map(Ri=>Ri.toFixed(4)).join(", ")}]`:"",readonly:!0}),Ro.jsx(pd,{label:"Current Hessian",value:li!==null?`[${li.map(Ri=>`[${Ri.map(Ts=>Ts.toFixed(4)).join(", ")}]`).join(", ")}]`:"",readonly:!0})]})]}),Ro.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[Ro.jsx(ST,{label:"Next Step",onClick:vr}),Ro.jsx(ST,{label:"Previous Step",onClick:Lr})]}),Ro.jsx(ST,{label:"Reset",onClick:lr})]}),xn==="Usage"&&Ro.jsx($U,{components:{h1:({children:Ri})=>Ro.jsx("h1",{className:"text-2xl font-bold mt-4 mb-2",children:Ri}),h2:({children:Ri})=>Ro.jsx("h2",{className:"text-xl font-semibold mt-4 mb-2",children:Ri}),h3:({children:Ri})=>Ro.jsx("h3",{className:"text-lg font-semibold mt-4 mb-2",children:Ri}),p:({children:Ri})=>Ro.jsx("p",{className:"leading-6 mb-3 last:mb-0",children:Ri}),ul:({children:Ri})=>Ro.jsx("ul",{className:"list-disc pl-5 mb-3",children:Ri}),ol:({children:Ri})=>Ro.jsx("ol",{className:"list-decimal pl-5 mb-3",children:Ri}),li:({children:Ri})=>Ro.jsx("li",{className:"mb-1",children:Ri})},children:aj})]})]})}function sj(Ie){return new Worker("/assets/pyodide.worker-jb0eIAfr.js",{name:Ie?.name})}function lj(Ie){const[ht,St]=up.useState({}),[wt,lr]=up.useState(!0),vr=up.useRef(null);function Lr(Tn){vr.current&&vr.current.postMessage({type:"INIT",settings:Tn})}function rn(){vr.current&&vr.current.postMessage({type:"NEXT_STEP"})}function xn(){vr.current&&vr.current.postMessage({type:"PREV_STEP"})}function $r(){vr.current&&vr.current.postMessage({type:"RESET"})}return up.useEffect(()=>{const Tn=new sj;return vr.current=Tn,Tn.onmessage=zn=>{const xa=zn.data;xa.type==="READY"?(console.log("Pyodide is ready"),lr(!1),Lr(Ie)):xa.type==="RESULT"&&St(Jn=>({functionValues:xa.data.functionValues||Jn.functionValues,trajectoryValues:xa.data.trajectoryValues||Jn.trajectoryValues}))},()=>{Tn.terminate()}},[]),{isLoading:wt,plotData:ht,sendInit:Lr,sendReset:$r,sendNextStep:rn,sendPrevStep:xn}}const uj={mode:"Univariate",functionExpr:"x^2",algorithm:"Gradient Descent",x0:"0.5",y0:"0.5",learningRate:"0.1",momentum:"0.0"},cj=[-1,1],fj=[-1,1];function hj(){const[Ie,ht]=up.useState(uj),St=up.useRef(cj),wt=up.useRef(fj),lr={...Ie,xlim:St.current,ylim:wt.current};function vr($r){ht($r),xn.sendInit({...$r,xlim:St.current,ylim:wt.current})}function Lr($r,Tn){St.current=$r,wt.current=Tn,xn.sendInit({...Ie,xlim:$r,ylim:Tn})}function rn(){const $r=St.current[1]-St.current[0],Tn=wt.current[1]-wt.current[0],zn=(St.current[0]+Math.random()*$r*.95).toFixed(2),xa=(wt.current[0]+Math.random()*Tn*.95).toFixed(2),Jn={...Ie,x0:zn,y0:xa};vr(Jn)}const xn=lj(lr);return Ro.jsxs("div",{className:"grid grid-cols-[1fr_12fr_1fr] lg:h-dvh bg-stone-50",children:[Ro.jsx("div",{}),Ro.jsxs("div",{className:"flex flex-col gap-6 p-6 min-h-0",children:[Ro.jsx("div",{className:"title",children:"Optimization Trajectory Visualizer"}),Ro.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] gap-12 flex-1 min-h-0 overflow-auto",children:[Ro.jsx(zO,{data:xn.plotData,isLoading:xn.isLoading,xlim:St.current,ylim:wt.current,setAxisLimits:Lr}),Ro.jsx(oj,{settings:Ie,setSettings:vr,onRandomInitialPoint:rn,trajectoryValues:xn.plotData.trajectoryValues,onReset:()=>xn.sendReset(),onNextStep:()=>xn.sendNextStep(),onPrevStep:()=>xn.sendPrevStep()})]})]}),Ro.jsx("div",{})]})}AO.createRoot(document.getElementById("root")).render(Ro.jsx(up.StrictMode,{children:Ro.jsx(hj,{})}));
dist/assets/{pyodide.worker-BFXTvOBt.js → pyodide.worker-jb0eIAfr.js} RENAMED
@@ -1,4 +1,4 @@
1
- (function(){"use strict";var s=`import numpy as np
2
  from sympy import (
3
  lambdify,
4
  symbols,
@@ -802,7 +802,6 @@ def rmsprop_bivariate(
802
  def adadelta_univariate(
803
  function: Expr,
804
  x0: float,
805
- learning_rate: float,
806
  beta: float,
807
  epsilon: float,
808
  steps: int,
@@ -844,7 +843,6 @@ def adadelta_bivariate(
844
  function: Expr,
845
  x0: float,
846
  y0: float,
847
- learning_rate: float,
848
  beta: float,
849
  epsilon: float,
850
  steps: int,
@@ -1007,4 +1005,4 @@ def adam_bivariate(
1007
  "gradient": gradient_values,
1008
  "hessian": hessian_values,
1009
  }
1010
- `;const f="https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.mjs";let e=null,a=null;async function r(){const{loadPyodide:n}=await import(f);e=await n({indexURL:"https://cdn.jsdelivr.net/pyodide/v0.26.1/full/"}),await e.loadPackage(["numpy","sympy"]),e.FS.writeFile("optimization_logic.py",l),e.FS.writeFile("optimization_manager.py",s),e.runPython("from optimization_manager import OptimizationManager; manager = OptimizationManager();"),a=e.globals.get("manager"),a||console.error("Failed to initialize optimization manager"),self.postMessage({type:"READY"})}function i(n){if(!n)return null;try{const t=n.toJs({dict_converter:Object.fromEntries});n.destroy&&n.destroy(),self.postMessage({type:"RESULT",data:t})}catch(t){console.error("Error handling Python result:",t)}}self.onmessage=async n=>{const t=n.data;if(!a){console.warn("Pyodide is not ready yet");return}switch(t.type){case"INIT":const o=e.toPy(t.settings);i(a.handle_update_settings(o));break;case"NEXT_STEP":i(a.handle_next_step());break;case"PREV_STEP":i(a.handle_prev_step());break;case"RESET":i(a.handle_reset());break;default:console.error("Unknown message type:",t);break}},r()})();
 
1
+ (function(){"use strict";var i=`import numpy as np
2
  from sympy import (
3
  lambdify,
4
  symbols,
 
802
  def adadelta_univariate(
803
  function: Expr,
804
  x0: float,
 
805
  beta: float,
806
  epsilon: float,
807
  steps: int,
 
843
  function: Expr,
844
  x0: float,
845
  y0: float,
 
846
  beta: float,
847
  epsilon: float,
848
  steps: int,
 
1005
  "gradient": gradient_values,
1006
  "hessian": hessian_values,
1007
  }
1008
+ `;const f="https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.mjs";let e=null,a=null;async function r(){const{loadPyodide:n}=await import(f);e=await n({indexURL:"https://cdn.jsdelivr.net/pyodide/v0.26.1/full/"}),await e.loadPackage(["numpy","sympy"]),e.FS.writeFile("optimization_logic.py",l),e.FS.writeFile("optimization_manager.py",i),e.runPython("from optimization_manager import OptimizationManager; manager = OptimizationManager();"),a=e.globals.get("manager"),a||console.error("Failed to initialize optimization manager"),self.postMessage({type:"READY"})}function s(n){if(!n)return null;try{const t=n.toJs({dict_converter:Object.fromEntries});n.destroy&&n.destroy(),self.postMessage({type:"RESULT",data:t})}catch(t){console.error("Error handling Python result:",t)}}self.onmessage=async n=>{const t=n.data;if(!a){console.warn("Pyodide is not ready yet");return}switch(t.type){case"INIT":const o=e.toPy(t.settings);s(a.handle_update_settings(o));break;case"NEXT_STEP":s(a.handle_next_step());break;case"PREV_STEP":s(a.handle_prev_step());break;case"RESET":s(a.handle_reset());break;default:console.error("Unknown message type:",t);break}},r()})();
dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Optimization</title>
8
- <script type="module" crossorigin src="/assets/index-BqVICm9j.js"></script>
9
  <link rel="stylesheet" crossorigin href="/assets/index-5gsYPC1K.css">
10
  </head>
11
  <body>
 
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Optimization</title>
8
+ <script type="module" crossorigin src="/assets/index-BoSq-s5V.js"></script>
9
  <link rel="stylesheet" crossorigin href="/assets/index-5gsYPC1K.css">
10
  </head>
11
  <body>
frontends/react/src/Sidebar.tsx CHANGED
@@ -11,7 +11,7 @@ const DEFAULT_HYPERPARAMETERS = {
11
  "Adam": { learningRate: "0.1", beta1: "0.9", beta2: "0.999", epsilon: "1e-8" },
12
  "Adagrad": { learningRate: "0.1", epsilon: "1e-8" },
13
  "RMSProp": { learningRate: "0.1", beta: "0.9", epsilon: "1e-8" },
14
- "Adadelta": { beta: "0.9", epsilon: "1e-8" },
15
  "Newton": {}
16
  }
17
 
 
11
  "Adam": { learningRate: "0.1", beta1: "0.9", beta2: "0.999", epsilon: "1e-8" },
12
  "Adagrad": { learningRate: "0.1", epsilon: "1e-8" },
13
  "RMSProp": { learningRate: "0.1", beta: "0.9", epsilon: "1e-8" },
14
+ "Adadelta": { beta: "0.9", epsilon: "1e-3" },
15
  "Newton": {}
16
  }
17