Skip to content

Changing number of Gaussians #75

@nstlz

Description

@nstlz

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.

Any suggestions as to what I am missing?

Thank you so much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions