I'm having trouble changing the number of Gaussians above 2 in code I'm slightly modifying from the tutorials.
d = ToyDataset()
n_samples = 1 << 14
n_gaussians = 4
X, yn = d.generate(n_samples // n_gaussians, 'gaussians', n_gaussians=n_gaussians, std_gaussians=0.5, radius=4, dim=2)
X = (X - X.mean())/X.std()
When I try to compute loss loss = nn.CrossEntropyLoss()(y_hat, y), for any value of n_samples larger than 2, I get a error saying IndexError: Target 3 is out of bounds.
In this case y will be the labels and if you add a new Gaussians the labels for it will be of a new class, in which case you need to add an additional output to your classifier.
I'm having trouble changing the number of Gaussians above 2 in code I'm slightly modifying from the tutorials.
When I try to compute loss
loss = nn.CrossEntropyLoss()(y_hat, y)
, for any value ofn_samples
larger than 2, I get a error sayingIndexError: Target 3 is out of bounds.
Any suggestions as to what I am missing?
Thank you so much!