Check y

By using the get_debug_values() function and with flag "theano.config.compute_test_value" turned on, we can now check the value of Y before computing kl or elemwise_kl. Note that this feature should only be expected to work in test time, not for passed values in a real function call.

Should we check every mode of "theano.config.compute_test_value" in the unit test? Or, since it is only a unit test for kl (or elemwise_kl), just testing it on one of the mode will be OK?
Yes, I agree the error information is not precise enough here. Now it has
been changed.

On Mon, Oct 6, 2014 at 3:08 PM, Bart van Merriënboer <
notifications@github.com> wrote:

> In pylearn2/expr/nnet.py:
>
> > @@ -200,6 +207,12 @@ def elemwise_kl(Y, Y_hat):
> >          raise ValueError("Expected Y_hat to be generated by an Elemwise "
> >                           "op, got "+str(op)+" of type "+str(type(op)))
> >      assert isinstance(op.scalar_op, T.nnet.sigm.ScalarSigmoid)
> > +
> > +    for Yv in get_debug_values(Y):
> > +        if not (Yv.min() >= 0.0 and Yv.max() <= 1.0):
> > +            raise ValueError("Y is expected to be purely binary. Either Y"
>
> Same here
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/lisa-lab/pylearn2/pull/1166/files#r18478108>.
>



-- 
LIN, Zhouhan
Department of Information Engineering
Harbin Institute of Technology

Phone: +86-151-2457-3193
Email: lin.zhouhan@gmail.com
Homepage:http://zhouhanlin.webs.com/