nicholas-leonard/dp

feedback modules option to specify pre-processing of targets to use?

dineshj1 opened this issue · 1 comments

Hi,
Thanks for this nice package!

This issue is a precursor to hopefully a minor pull request.

Gist: I think feedback modules should provide the ability to specify which dimension/other pre-processing of the target they should use. This is similar functionality to "output_module", but for the targets instead of the outputs.

Long: I'm working with multi-dimensional targets for various losses in a ParallelCriterion. One of these is a class label. When I set up dp.Optimizer/Evaluator, I'd like to be able to specify in, say, a "dp.Confusion" feedback module setup which dimension of the target it should work with. I'm pretty new to dp, Torch and Lua in general, but If I'm not mistaken, there doesn't seem to currently be a way to set this up.

I have made a minor mod of feedback/confusion.lua that works fine for selecting a specific dimension of target (through a new "target_dim" option in the constructor). I could create a PR (with similar patches for other feedback modules) if you think it would be useful. A more general solution might be to specify a "target_module", itself an nn.Module(), through which to pass batch targets.

Yes please submit a PR!