update readme

pull/17/head
KaiyangZhou 2018-03-27 12:12:13 +01:00
parent 2f9d3dcaa1
commit 85a9bb2d40
1 changed files with 2 additions and 0 deletions

View File

@ -173,6 +173,8 @@ param_groups = [
# that has two components (base and classifier). Modify the code to adapt to your model.
optimizer = torch.optim.Adam(param_groups, lr=args.lr, weight_decay=args.weight_decay)
```
Of course, you can pass `model.classifier.parameters()` to optimizer if you only need to train the classifier (in this case, setting the `requires_grad` wrt the base model to false will be more efficient).
## References
[1] [He et al. Deep Residual Learning for Image Recognition. CVPR 2016.](https://arxiv.org/abs/1512.03385)<br />