karpathy / neuraltalk

NeuralTalk is a Python+numpy project for learning Multimodal Recurrent Neural Networks that describe images with sentences.
5.4k stars 1.33k forks source link

Maybe a mistake in lstm_generator.py #41

Open liu09114 opened 8 years ago

liu09114 commented 8 years ago

In the lstm_generator.py, line 71 Hin[t,1:1+d] = X[t] and 72 Hin[t,1+d:] = prev should be exchanged. Because the hidden size is d, which is the dimension of the prev. But i don't why it doesn't raise an error, anyone can explain this?

liu09114 commented 8 years ago

I know why it doesn't raise an error. The default parameter of the image encoding size (also the input size) id equal to the hidden size. But the mistake should be correct.

karpathy commented 8 years ago

oops, i think you're probably right. If you try to meddle with the sizes it would error.