Skip to content

Commit

Permalink
Use one byte instead of four for n-hot label bits.
Browse files Browse the repository at this point in the history
  • Loading branch information
William Nurmi committed Mar 7, 2018
1 parent 6d0e116 commit 9a3d8d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastai/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def copy_or_move_with_subdirs(subdir_lst, src, dst, r, move=False):
do(f, os.path.join(dst, subdir, os.path.split(f)[1]))

def n_hot(ids, c):
res = np.zeros((c,), dtype=np.float32)
res = np.zeros((c,), dtype=np.int8)
res[ids] = 1
return res

Expand Down

0 comments on commit 9a3d8d5

Please sign in to comment.