gsn_example.py bug

11 views
Skip to first unread message

Isaac Gerg

unread,
Nov 11, 2015, 5:27:34 PM11/11/15
to pylearn-dev
   alg = SGD(
        LEARNING_RATE,
        init_momentum=MOMENTUM,
        cost=c,
        termination_criterion=EpochCounter(MAX_EPOCHS),
        batches_per_iter=BATCHES_PER_EPOCH,
        batch_size=BATCH_SIZE,
        monitoring_dataset=ds,
        monitoring_batches=10,
    )

"init_momentum" is not a parameter for SGD.

After commenting out, now getting "ValueError: Can't convert to VectorSpace of dim 1. Expected either dim=10 (merged one-hots) or 10 (concatenated one-hots)"

Pascal Lamblin

unread,
Nov 11, 2015, 7:54:13 PM11/11/15
to pylea...@googlegroups.com
On Wed, Nov 11, 2015, Isaac Gerg wrote:
> alg = SGD(
> LEARNING_RATE,
> init_momentum=MOMENTUM,
> cost=c,
> termination_criterion=EpochCounter(MAX_EPOCHS),
> batches_per_iter=BATCHES_PER_EPOCH,
> batch_size=BATCH_SIZE,
> monitoring_dataset=ds,
> monitoring_batches=10,
> )
>
> "init_momentum" is not a parameter for SGD.

Right, I think it has been removed from the SGD class, you would have to pass to SGD something like:

learning_rule=Momentum(init_momentum=MOMENTUM),

> After commenting out, now getting "ValueError: Can't convert to VectorSpace
> of dim 1. Expected either dim=10 (merged one-hots) or 10 (concatenated
> one-hots)"

This is probably coming from a mismatch of the target/prediction data,
where one part of the code produces a vector of 10 probability values,
and another part expects one single index.
It may come from the use of "ds.y.shape[1]", which would return 10 if
the targets for MNIST were stored in a one-hot format, but now returns 1.

>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "pylearn-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylearn-dev...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Pascal

Isaac Gerg

unread,
Nov 11, 2015, 10:13:40 PM11/11/15
to pylearn-dev
Pascal, thanks.  Can you help me hunt this down so that I can fix the problem and upload a new version of the example?  Id like to correct it.
Reply all
Reply to author
Forward
0 new messages