artofscience / SAOR

Sequential Approximate Optimization Repository
GNU General Public License v3.0
5 stars 1 forks source link

Union of Approximation and Intervening variables? #128

Open artofscience opened 2 years ago

artofscience commented 2 years ago

Note the following:

class Approximation: def g def dg def ddg def update def clip

class Intervening: def y def dydx def ddyddx def update def clip

Woh? They are so similar. Why not make a single class?

Both are actually just functions with derivatives...

Then we can e.g. do things like

approx = Taylor2(Taylor1(resp(2)=Taylor1(MMA()), resp(3)=Taylor2(Taylor1(Reciprocal())), resp(0)=Linear())

artofscience commented 2 years ago

side note: it also looks like approximation and intervening (or maybe in future "mapping") could inherit from "problem", since "problem" is also "just" a function with g, dg, ddg