Closed emma-sjwang closed 5 years ago
Hello @EmmaW8 , basically after the first stage, where a plain base model is trained, we use the plain model to calculate the class centers. Then in the beginning of the second stage, we use these centers to initialize the self.criterions['FeatureLoss'].centroids.data
, and from https://github.com/zhmiao/OpenLongTailRecognition-OLTR/blob/master/run_networks.py#L98 , we initialize an optimizer for the criterion. During training, in the self.batch_backward()
function (https://github.com/zhmiao/OpenLongTailRecognition-OLTR/blob/master/run_networks.py#L139), the criterion optimizer is stepped, and this is where the centroids are updated according to the losses, because centroids are updateable parameters of the feature criterion in stage 2. Does this make sense to you?
@zhmiao Thank you for your detailed responce. :) It is clear to me now~
Thanks for the awesome work.
But I do not find the related codes to update the centroids. In line 45 of file
run_networks.py
:these codes are utilized for centroids initialization.
In the paper, Section 3.1, Para Learning Visual Memory M, the centroids are updated in two steps. Could you kindly give me more hints about how to realize the second step, which is the propagation step by alternatively updating the direct feature and the centroids.
Thanks a lot.