Skip to content

Commit

Permalink
Precommit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinds committed Aug 30, 2023
1 parent 6fa5812 commit c829517
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nobrainer/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from .io import _is_gzipped, verify_features_labels
from .tfrecord import _labels_all_scalar, parse_example_fn, write
from .volume import binarize, replace, standardize, to_blocks
from .volume import binarize, replace, to_blocks

AUTOTUNE = tf.data.experimental.AUTOTUNE

Expand Down Expand Up @@ -315,9 +315,9 @@ def map_labels(self, label_mapping=None):
if self.n_classes == 1:
self.map(lambda x, y: (x, tf.expand_dims(binarize(y), -1)))
elif self.n_classes == 2:
self.map(lambda x, y: (x, tf.one_hot(binarize(y), n_classes)))
self.map(lambda x, y: (x, tf.one_hot(binarize(y), self.n_classes)))
elif self.n_classes > 2:
self.map(lambda x, y: (x, tf.one_hot(y, n_classes)))
self.map(lambda x, y: (x, tf.one_hot(y, self.n_classes)))

return self

Expand Down

0 comments on commit c829517

Please sign in to comment.