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?
Hi Pascal

Now I have refined the expression: )

On Monday, October 6, 2014, Pascal Lamblin <notifications@github.com> wrote:

> In pylearn2/expr/nnet.py:
>
> > @@ -149,6 +150,12 @@ 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)
> > +
> > +    for Yv in get_debug_values(Y):
> > +        if not (Yv.min() >= 0.0 and Yv.max() <= 1.0):
> > +            raise ValueError("Expected Y to be between 0 and 1. Either Y"
> > +                             + "< 0. or Y > 1 is got in the input.")
>
> Should be "was found" rather than "is got". I would also get rid of the
> "." after "0", but it's not a big deal.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/lisa-lab/pylearn2/pull/1166/files#r18481107>.
>


-- 
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/