torch / cunn

Other
215 stars 174 forks source link

Update to ignore zero targets #458

Closed jnhwkim closed 7 years ago

jnhwkim commented 7 years ago

If the target is zero, loss and gradient of input are reminded to be zero. It is useful for variable-length NL generation models.

nicholas-leonard commented 7 years ago

@jnhwkim Thanks!

jnhwkim commented 7 years ago

I think nn should be consistent with this. I'll look into it, shortly.

nicholas-leonard commented 7 years ago

@jnhwkim I am working on nn version of this: https://github.com/torch/nn/pull/1215