Closed pxssw closed 2 years ago
Hi, @pxssw
It's an implementation of the spatial weight mechanism described in section 4.1 of this paper. The hook is registered to average the gradients by the number of the channels. About function hook in PyTorch, take a look at this.
umm I got it, Thanks. But when make the ' x = self.feature_extractor(x) y = F.relu(self.conv(x)) x = x * y' the y means Spatial Weights, Whether it is necessary to make the y pass though a logistic function? Considering whether the result is too big.
Sorry, I don't understand what you are asking. But anyway, if you have another idea, it's nice to try it out.
The process above just is the 'forward' function of 'resnet_simplt.py' , and 'y = F.relu(self.conv(x)) x = x * y' is the application of '_register_hook'(4.1 part of the parer). I was just wondering about the 'y' (Spatial Weights) should be normalized into [0,1] or not.
Ah, I see. Yes, using sigmoid instead of ReLU is a possible option. I've tried some structures including changing backbones and the attention branch, but they didn't make much difference. But what I tried is not exhaustive, so some ideas may work better.
OK, thanks a lot. I have one more question, how the '_compute_normalizing_rotation' of '/gaze_estimation/gaze_estimator/head_pose_estimation/head_pose_normalizer.py' works? can you give me some simple describtion or inference of math?Thanks!
@pxssw
It's an implementation of what's described in Figure 9 and section 4.2 of this paper, so taking a look at them would help.
get it , thanks a lot!
Hi boy, it`s a great job, but I'm puzzled about the process in 'resnet_simplt.py' getting the '_register_hook'. Why this step is needed in the model init ?