summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-12-19 21:20:23 +0100
committerJules Laplace <julescarbon@gmail.com>2019-12-19 21:20:23 +0100
commit9a3c95e2274d770173c508e4da9fbdcd07f3fa5f (patch)
tree96dd7ad90651c64130e127054fd97d217b81a458
parentdce014e69e4fc2bd9a110d5a9e7334a9824be215 (diff)
fix class
-rw-r--r--inversion/live.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/inversion/live.py b/inversion/live.py
index be03422..6894b47 100644
--- a/inversion/live.py
+++ b/inversion/live.py
@@ -67,7 +67,7 @@ def clamp(n, a=0, b=1):
def label_sampler(num_classes=1, shape=(BATCH_SIZE, N_CLASS,)):
label = np.zeros(shape)
for i in range(shape[0]):
- for _ in range(random.randint(1, shape[1])):
+ for _ in range(num_classes):
j = random.randint(0, shape[1]-1)
label[i, j] = random.random()
print("class: {} {}".format(j, label[i, j]))