Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the program to a classification model ? #60

Closed
HuskyXPZ opened this issue Nov 10, 2022 · 1 comment
Closed

How to change the program to a classification model ? #60

HuskyXPZ opened this issue Nov 10, 2022 · 1 comment

Comments

@HuskyXPZ
Copy link

HuskyXPZ commented Nov 10, 2022

I have a time series data and I want to change the program to a model for classification.

The following is the part I changed in the program

Before:

# Output module
output = self._linear(decoding)
output = torch.sigmoid(output)

After:

# Output module
output = self._linear(decoding) 
output_softmax = torch.softmax(output)

After the modification, the program has the following error:

ValueError: Expected target size (64, 3), got torch.Size([64])

By the way, my data size is (64,55,20), and my category labels have three.

@maxjcohen
Copy link
Owner

Hi, we're going to need more information in order to better understand what is happening. What line raises this error, and the full backtrace ? What are your labels shape ? Please see #18 for more information about applying the model to a classification task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants