You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Find input instances from minority classes, and concatenate them to evaluation data/label tensors later.
121
+
This facilitates the inclusion of minority class samples into memory when ASER's update method is used under online-class incremental setting.
122
+
123
+
More details:
124
+
125
+
Evaluation set may not contain any samples from minority classes (i.e., those classes with very few number of corresponding samples stored in the memory).
126
+
This happens after task changes in online-class incremental setting.
127
+
Minority class samples can then get very low or negative KNN-SV, making it difficult to store any of them in the memory.
128
+
129
+
By identifying minority class samples in the current input batch, and concatenating them to the evaluation set,
130
+
KNN-SV of the minority class samples can be artificially boosted (i.e., positive value with larger magnitude).
131
+
This allows to quickly accomodate new class samples in the memory right after task changes.
132
+
133
+
Threshold for being a minority class is a hyper-parameter related to the class proportion.
134
+
In this implementation, it is randomly selected between 0 and 1 / number of all classes for each current input batch.
135
+
136
+
137
+
Args:
138
+
cur_x (tensor): current input data tensor.
139
+
cur_y (tensor): current input label tensor.
140
+
mem_size (int): memory size.
141
+
num_class (int): number of classes in dataset.
142
+
Returns
143
+
minority_batch_x (tensor): subset of current input data from minority class.
144
+
minority_batch_y (tensor): subset of current input label from minority class.
145
+
"""
146
+
# Select input instances from minority classes that will be concatenated to pre-selected data
0 commit comments