From: Francois Fleuret Date: Wed, 18 Dec 2019 17:42:36 +0000 (+0100) Subject: Added the 5 cluster data-set. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=fe7bae674b22a2ec4994a34be4a509b1a0d0ba72;p=pytorch.git Added the 5 cluster data-set. --- diff --git a/denoising-ae-field.py b/denoising-ae-field.py index cc4af81..effee19 100755 --- a/denoising-ae-field.py +++ b/denoising-ae-field.py @@ -31,10 +31,19 @@ def data_spiral(nb): 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)