gcr / torch-residual-networks

This is a Torch implementation of ["Deep Residual Learning for Image Recognition",Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun](http://arxiv.org/abs/1512.03385) the winners of the 2015 ILSVRC and COCO challenges.
zlib License
576 stars 146 forks source link

training data also normalized? #12

Open hli2020 opened 8 years ago

hli2020 commented 8 years ago

Hi G, I am so new to Torch, just a quick concern about fetching training data. The training data is supposed to be normalized, too. However, I see no such operation in the dataTrain:getBatch() call. Specifically, the code here does not pass input value back to batch. Can you point out where I misunderstood? Thanks!

hughperkins commented 8 years ago

If I'm reading correctly:

(Edit: actually, input is not a refernce variable, it's actually a brand-new torch tensor, but that tensor has the exact same underlying storage as the origianl tensor, and any changes to the data in the input tensor write through to the exact same storage in the original tensor. this is probably the new information you are looking for?)

gcr commented 8 years ago

Yes, that's right. Perhaps this should have been made more clear with a comment or something: input refers to the same memory as batch.inputs, so mutating the values at input will also propagate to batch.input