How to get center of features?

In supervised manner, How can I get center of the features on each classes?
Do I need to use clustering algorithms like k-means?
or Can I get center feature using only labeled features?

Why use k-means in supervised manner?

How can I get the center of the features per classes?
in mini-batch,
outputs = model(inputs)
(sum of all outputs which have same class) / mini_batch_size is center?

Sorry, I don’t know.
I am currently studying face recognition. In face recognition, such as ArcFace, center of features of each class is a learnable matrix, which shape is (embedding_len, num_classes).