Skip to content

Commit f48af1c

Browse files
[losses] Remove useless '_' in public function.
1 parent 06626ee commit f48af1c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

inclearn/lib/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def to_onehot(targets, n_classes):
1717
return onehot
1818

1919

20-
def _check_loss(loss):
20+
def check_loss(loss):
2121
return not bool(torch.isnan(loss).item()) and bool((loss >= 0.).item())
2222

2323

@@ -168,8 +168,9 @@ def apply_kmeans(features, targets, nb_clusters, pre_normalization):
168168
return np.concatenate(new_features), np.concatenate(new_targets)
169169

170170

171-
def apply_knn(features, targets, features_test, targets_test, nb_neighbors, normalize=True,
172-
weights="uniform"):
171+
def apply_knn(
172+
features, targets, features_test, targets_test, nb_neighbors, normalize=True, weights="uniform"
173+
):
173174
print(
174175
"KNN with {} neighbors and pre-normalized features: {}, weights: {}.".format(
175176
nb_neighbors, normalize, weights

inclearn/models/icarl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _forward_loss(self, training_network, inputs, targets, memory_flags):
237237

238238
loss = self._compute_loss(inputs, outputs, targets, onehot_targets, memory_flags)
239239

240-
if not utils._check_loss(loss):
240+
if not utils.check_loss(loss):
241241
pdb.set_trace()
242242

243243
self._metrics["loss"] += loss.item()

0 commit comments

Comments
 (0)