Why center loss used a random intialized center?

Hi~ I'm now using the implementation from , and the center was initilized as self.centers = nn.Parameter(torch.randn(self.num_classes, self.feat_dim)). I'm confused why this kind of initialization guarantee the final center is the center of the given features/embeddings in a certain class?

I tried this center loss as above but confused why it works in theory?

1

1 Answer

Because the random initialization doesn't change the end result. It gives a direction for the backpropagation that the embeddings will get closer the to the centers and it doesn't matter which location of the centers that you chooose. It'll achieve the purpose ultimately.

This happens in the training phase.

In the testing phase, the feature extraction model that you trained is used and the center location information is not used at all.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like