Commit c07ae34a authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by Minjie Wang
Browse files

[Bugfix] removing non-determinism in data loading (#413)

[Bugfix] Removing non-determinism in data loading
parent 565f0c88
...@@ -389,7 +389,7 @@ def _normalize(mx): ...@@ -389,7 +389,7 @@ def _normalize(mx):
return mx return mx
def _encode_onehot(labels): def _encode_onehot(labels):
classes = set(labels) classes = list(sorted(set(labels)))
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
enumerate(classes)} enumerate(classes)}
labels_onehot = np.array(list(map(classes_dict.get, labels)), labels_onehot = np.array(list(map(classes_dict.get, labels)),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment