Break optimization loop in local_mul_canonizer in a cleaner way
In tensor/opt.py:Canonizer.simplify_constants,
http://trac-hg.assembla.com/theano/browser/theano/tensor/opt.py?rev=3701%3Ac89e332bb18a* L1412,
a simplification is sometimes not applied, so that no substitution is performed by local_mul_canonizer, and the EquilibriumOptimizer it is in does not loop.
If the code block mentionned above is commented out, local_mul_canonizer appears to introduce a DimShuffle node as a replacement for the input, which triggers local_dimshuffle_lift (and some others), then getting back to local_mul_canonizer.
The solution would be NOT to introduce a new DimShuffle node on top.
http://trac-hg.assembla.com/theano/browser/theano/tensor/opt.py?rev=3701%3Ac89e332bb18a* L1412,
a simplification is sometimes not applied, so that no substitution is performed by local_mul_canonizer, and the EquilibriumOptimizer it is in does not loop.
If the code block mentionned above is commented out, local_mul_canonizer appears to introduce a DimShuffle node as a replacement for the input, which triggers local_dimshuffle_lift (and some others), then getting back to local_mul_canonizer.
The solution would be NOT to introduce a new DimShuffle node on top.
Leave a comment
on 2010-04-23 22:12 *
By james.bergstra
This is not so severe because the specialize phase re-runs all the optimizations in question except the canonicalizer.... so that typically this gets cleaned up correctly anyway.