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?
So, should we manually set the debug value of Y in the open interval of (0,
1) during the test, and deem both Y=0. and Y=1. as fault value?

BTW, I added some new modifications like 1h before, adjusting the try
blocks. Can you see it from your side?
On Friday, October 3, 2014, Pascal Lamblin <notifications@github.com> wrote:

> In pylearn2/expr/nnet.py:
>
> > @@ -149,6 +150,14 @@ def kl(Y, Y_hat, batch_axis):
> >          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)
> > +
> > +    if theano.config.compute_test_value != 'off':
> > +        for Yv in get_debug_values(Y):
> > +            if not (Yv.min() >= 0.0 and Yv.max() <= 1.0):
>
> I think values between 0 and 1 should be OK as well, I asked the question
> on #965 <https://github.com/lisa-lab/pylearn2/issues/965> to be sure.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/lisa-lab/pylearn2/pull/1166/files#r18421273>.
>