htqin / IR-Net

[CVPR 2020] This project is the PyTorch implementation of our accepted CVPR 2020 paper : forward and backward information retention for accurate binary neural networks.
177 stars 38 forks source link

Is there a special way to train on ImageNet with the yaml file? #5

Closed licj15 closed 4 years ago

licj15 commented 4 years ago

Hi everyone,

I noticed that in the CIFAR-10 folder, IR-Net has a trainer.py file for each experiment setting. But in the ImageNet folder, there is no such a trainer.py, and only a .yaml file. Does it mean that we need to write a trainer.py ourselves based on the hyperparams in the yaml file for ImageNet experiments? Or there is a way to train on ImageNet using these yaml files directly?

Thank you!

brisker commented 4 years ago

@htqin I can not find any code corresponding to the information entropy therory discussed in your paper. Does this mean that, actually you did not use this information entropy loss in your model training??

htqin commented 4 years ago

@licj15 Thanks for your attention. The training code for imagenet model cannot open source temporarily since it based on a framework of SenseTime. You can write a trainer.py based on the hyperparams in the yaml file.

htqin commented 4 years ago

@brisker Sure, there is no extra loss in our IR-Net, we maximize the information entropy by Libra-PB. https://github.com/htqin/IR-Net/blob/master/CIFAR-10/ResNet20/1w1a/modules/ir_1w1a.py#L18-L21

licj15 commented 4 years ago

@htqin Thank you for your quick response! I notice in the yaml

    augmentation:
        input_size: 224
        test_resize: 256
        colorjitter: [0.2, 0.2, 0.2, 0.1] 
  1. Does it mean you use 224224 for train, and upsample it to 256256 during test? If so, I noticed you didn't mention so in your paper, do you have any references for this? I was wondering if such techniques are also used in baselines.
  2. Do you only use "colorjitter: [0.2, 0.2, 0.2, 0.1]" for augmentation? Do you use random crop or flip? Because I noticed you use such augmentation in CIFAR-10, not sure if you use any other augmentation beside "colorjitter: [0.2, 0.2, 0.2, 0.1]" for ImageNet.

Thank you! Your efforts and the sprit to open source will benefit the community a lot!