Comments (1)
Same as multiclass classification with few modifications.
- n_classes = 2, in last layer , self.out = nn.Linear(self.bert.config.hidden_size, n_classes), actually this will be automatically handled by the code for mutlicalss classification itself --- model = SentimentClassifier(len(class_names))
- replace softmax with sigmoid here --- F.softmax(model(input_ids, attention_mask), dim=1)
- loss function should be changed to BinaryCrossEntropyLoss i.e nn.BCELoss() from ---- loss_fn = nn.CrossEntropyLoss().to(device)
from getting-things-done-with-pytorch.
Related Issues (20)
- please share notebook
- weather data permission HOT 1
- ann_viz() not defined in text
- ann_viz() does not use the parameter view
- Slightly different kind of labels for the input ( Multi-label Text Classification with BERT and PyTorch Lightning)
- Please upload code for youtube video HOT 1
- DataLoader problem HOT 1
- CUDA out of memory. Tried to allocate 384.00 MiB (GPU 0; 15.90 GiB total capacity; 14.69 GiB already allocated; 291.75 MiB free; 14.76 GiB reserved in total by PyTorch) HOT 1
- arff2pandas is not supported anymore. Could anyone find alternative for this library? HOT 2
- LSTM autoencoder vs ANN autoencoder
- AttributeError: 'dict' object has no attribute 'dataset' HOT 1
- Problem printing the shape of last_hidden_state and pooled_output
- Error: ModelCheckpoint(monitor='val_loss') not found in the returned metrics
- How to Export 'ONNX' Model?
- Multi class time series classification
- How to handle imbalanced classes ? HOT 1
- 8. sentiment-analysis-with-bert HOT 5
- Missing Notebook on T5 Fine-tuning
- Image files not available anymore HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getting-things-done-with-pytorch.