|
Algorithm 1 Pseudocode for Stage 2 CCL Optimization |
Require: A batch of features , fixed centroids , margin m.
-
1:
// Step 1: Assign pseudo-labels
-
2:
for all feature do
-
3:
Assign pseudo-label .
-
4:
end for
-
5:
// Step 2: Construct pairs and compute loss
-
6:
Normalize features to get .
-
7:
Compute similarity matrix .
-
8:
Construct positive pair set .
-
9:
Construct negative pair set .
-
10:
.
-
11:
.
-
12:
.
-
13:
// Step 3: Update model
-
14:
Update feature extractor via gradient descent on .
|