karpathy / neuraltalk2

Efficient Image Captioning code in Torch, runs on GPU
5.51k stars 1.26k forks source link

gradCheckLM and gradCheck can't pass gradcheck test #118

Open jackevan1 opened 8 years ago

jackevan1 commented 8 years ago

Hi @karpathy and All,

I have been trying to find out that whether or not there is any problems with gradient calculation of LanguageModel and LanguageModelCriterion since gradCheckLM and gradCheck fail in " "test_language_model.lua" couple of times, especially gradCheckLM. I did my own calculations and results are same as Karpathy but still gradcheck fails and don't know what is the problem. I was wondering does anybody know where is the bug/problem if there is any?

Thanks PS: To be clear, the current version of the code fails the gradient check. Clone the code and run test_language_model.lua couple of times to see the fail cases.