Cysu / open-reid

Open source person re-identification library in python
https://cysu.github.io/open-reid/
MIT License
1.33k stars 349 forks source link

The forward function of a model #57

Closed huanghoujing closed 6 years ago

huanghoujing commented 6 years ago

Hi, Tong Xiao.

In the forward function of ResNet or InceptionNet, I am confused by the following two lines:

if self.norm:
    x = F.normalize(x)
elif self.has_embedding:
    x = F.relu(x)

Why should normalize and relu be exclusive to each other? Should the elif here be if instead?

Waiting for your response. Thanks a lot!

Cysu commented 6 years ago

Normalization will make features unit vector. ReLU will violate such constraints.

huanghoujing commented 6 years ago

Thank you! I understand it now.