Views
No views yet
max_seq_length=512.| Hyperparameter | Value |
|---|---|
| Epochs | 30 (early stopping after 5 epochs without improvement) |
| Batch size | 64 |
| Learning rate | 1e-4 |
| Weight decay | 0.01 |
| Warmup steps | 500 |
| Random seed | 786 |
| Hardware | NVIDIA RTX 3090 (24 GB) |
textattack train --model-name-or-path lstm \
--dataset imdb \
--model-max-length 512 \
--epochs 30 \
--early-stopping-epochs 5 \
--per-device-train-batch-size 64 \
--learning-rate 1e-4 \
--save-last \
--output-dir ./models/lstm-imdb-512| Metric | Value |
|---|---|
| Accuracy | 86.47% |
textattack library. TextAttack's from_pretrained does not currently resolve Hugging Face Hub IDs — download the snapshot first via huggingface_hub, then pass the local path:1from huggingface_hub import snapshot_download
2from textattack.models.helpers import LSTMForClassification
3
4local_dir = snapshot_download(repo_id="jongador/lstm-imdb-512")
5model = LSTMForClassification.from_pretrained(local_dir)