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

Helper code for NLP Lab #130

Open
pxaris opened this issue Apr 25, 2024 · 1 comment
Open

Helper code for NLP Lab #130

pxaris opened this issue Apr 25, 2024 · 1 comment

Comments

@pxaris
Copy link
Contributor

pxaris commented Apr 25, 2024

Issue που θα χρησιμοποιηθεί κατά τη διάρκεια του Εργαστηρίου NLP (στις 26/4/24) για τη σημείωση βοηθητικού κώδικα, οδηγιών κ.α.

@pxaris
Copy link
Contributor Author

pxaris commented Apr 26, 2024

Pre-lab - 8

criterion = torch.nn.BCEWithLogitsLoss() if n_classes == 2 else torch.nn.CrossEntropyLoss() 
parameters = [param for param in model.parameters() if param.requires_grad]
optimizer = torch.optim.Adam(parameters, lr=0.001)

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

1 participant