Giter VIP home page Giter VIP logo

Comments (5)

nouiz avatar nouiz commented on September 27, 2024

On Fri, Oct 28, 2011 at 11:53 AM, James Bergstra
[email protected]
wrote:

It's nice to have constant folding as a local optimizer so that it can be done during stabilization and specialization.

For better performance - and to permit lowering the max_use_ratio back to a sane level, it would also be good to do Constant folding "passes" similar to what the MergeOptimizer does.  Since constant folding is a kind of bottom-up transformation, a single pass could fold entire subgraphs all at once. This would be faster, because it would avoid running all of the equilibrium optimizers between every constant-folding substitution!

I would suggest making a single pass of the ConstantFoldingOptimizer, after stabilization, but before specialization. We don't do any constant folding before specialization right?

We do it... It is not trivial to move them after stabilize as this
disable some optimization done in the Canonicalize...

from theano.

jaberg avatar jaberg commented on September 27, 2024

On Fri, Oct 28, 2011 at 11:57 AM, nouiz
[email protected]
wrote:

I would suggest making a single pass of the ConstantFoldingOptimizer, after stabilization, but before specialization. We don't do any constant folding before specialization right?

We do it... It is not trivial to move them after stabilize as this
disable some optimization done in the Canonicalize...

Ok, then maybe a preliminary greedy constant-folding pass could be
done before canonicalize? Maybe we can even recognize safe vs. unsafe
folding operations before canonicalize?

from theano.

nouiz avatar nouiz commented on September 27, 2024

I have no idea how to recognize safe vs unsafe folding operation. The real fix is to "port" the Canonicalizer optimizer to after the constant folding phase. But we must change the Canonicalizer to change the graph only when it do some optimization at the same time...

What about just rerunning the full Canonicalizer instead? In summary what about this:

  1. current canonicalization phase without constant folding
  2. current stabilize phase without constant folding
  3. constant folding phase
  4. new Canonizer class phase or the current canonicalization phase WITH constant folding
  5. we continue....

There is also the blas opt some where in there.

from theano.

lamblin avatar lamblin commented on September 27, 2024

We now have topo_constant_folding running at a couple of places, which is simply defined as in2out(constant_folding).

from theano.

nouiz avatar nouiz commented on September 27, 2024

from theano.

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.