data = torch.cat((y, x), 1)
return data
+def data_penta(nb):
+ a = (torch.randint(5, (nb,)).float() / 5 * 2 * math.pi).view(-1, 1)
+ x = a.cos()
+ y = a.sin()
+ data = torch.cat((y, x), 1)
+ data = data + data.new(data.size()).normal_(0, 0.05)
+ return data
+
######################################################################
-# data = data_spiral(1000)
-data = data_zigzag(1000)
+data = data_spiral(1000)
+# data = data_zigzag(1000)
+# data = data_penta(1000)
data = data - data.mean(0)