Yao-DD / S3N

86 stars 26 forks source link

Some confusion #6

Open boxyao opened 4 years ago

boxyao commented 4 years ago

I find self.raw_classifier = nn.Linear(2048, num_classes) define in init in Class S3N but I can't find self.raw_classifier add to the graph in the forward() before the first line code self.maporigin.weight.data.copy(self.raw_classifier.weight.data.unsqueeze(-1).unsqueeze(-1)). Could you slove my confusion? Thank you~

Yao-DD commented 4 years ago

We define self.map_origin just for convenience when computing class response maps. So self.map_origin copies data of self.raw_classifier. self.raw_classifier is added to the graph in the forward when "agg_origin = self.raw_classifier(self.avg(feature_raw).view(-1, 2048))"

boxyao commented 4 years ago

Thank you very much!