[bug] EquilibriumOptimizer max'ed out by 'local_add_canonizer'.

25 views
Skip to first unread message

Valentin Bisson

unread,
Feb 1, 2012, 1:58:53 PM2/1/12
to thean...@googlegroups.com
Hi,

Theano seems to have an undesired behavior when passed NaNs as input (I was primarily trying to test a NaN detection hack)

This piece of code shows what I am talking about:

import theano
import numpy

x = theano.tensor.vector()
f = theano.function([x], x + numpy.nan)
f(numpy.zeros(3, dtype=numpy.float32))

f compilation throws the following error:

ERROR (theano.gof.opt): EquilibriumOptimizer max'ed out by 'local_add_canonizer'. You can safely raise the current threshold of 20.000000 with the theano flag 'optdb.max_use_ratio'.

First, this error does not keep f from working.

Second, the exception keeps being raised, no matter what optdb.max_use_ratio is is set to.

Insight: this might be caused by nan being neither greater of lesser than anything, provoking an endless loop in the canonizer/optimizer.

Olivier Delalleau

unread,
Feb 2, 2012, 10:24:22 AM2/2/12
to thean...@googlegroups.com
I'll be sending a pull request with a fix later today (once I make sure all tests pass).

-=- Olivier

Frédéric Bastien

unread,
Feb 2, 2012, 1:19:21 PM2/2/12
to thean...@googlegroups.com
The pull request is now merged.

Fred

Reply all
Reply to author
Forward
0 new messages