Git Product home page Git Product logo

Comments (2)

saulshanabrook avatar saulshanabrook commented on May 18, 2024 1

I took a look at this function to see what we would need to "mock" to be able to turn this function into an expression graph.

One question is how we get the data into a graph, instead of a literal. The data comes from a RNG. We can pass in a custom RNG that we fake it into thinking is a numpy RNG subclass.

So that can work. But then the core flow of the algorithm is a loop with checking each iteration if we are done or not.

We cannot override this control flow and turn it into a graph. jax has the same issue, that it cannot process things like if statements if they are based on dynamic data.

So it seems like to make this library useful in passing into SciPy, we would need a way to process control flow.

Numba does this already.

If we take a step back, what we are doing is having to translate between statement blocks and an expression graph. This seems to be explored in the compiler community as translating between control flow graphs and value state dependence graphs:

Screen Shot 2019-04-05 at 11 57 11 AM

cc @rgommers who brought up this original question.

from metadsl.

rgommers avatar rgommers commented on May 18, 2024 1

So it seems like to make this library useful in passing into SciPy, we would need a way to process control flow.

I think this particular problem is mostly specific to scipy.optimize. Pretty much all optimizers and root finders have this kind of tolerance-based termination of iteration. Most of the rest of SciPy does not.

The issue you'll encounter more is probably functions implemented in compiled code or calling compiled code expecting real numpy arrays under the hood.

from metadsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.