Skip to content

Commit a919deb

Browse files
committed
Add models to README
1 parent 8bdbca7 commit a919deb

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
This repository consists of:
44

55
- [vision.datasets](#datasets) : Data loaders for popular vision datasets
6+
- [vision.models](#models) : Definitions for popular model architectures, such as AlexNet, VGG, and ResNet and pre-trained models.
67
- [vision.transforms](#transforms) : Common image transformations such as random crop, rotations etc.
78
- [vision.utils](#utils) : Useful stuff such as saving tensor (3 x H x W) as image to disk, given a mini-batch creating a grid of images, etc.
8-
- `[WIP] vision.models` : Model definitions and Pre-trained models for popular models such as AlexNet, VGG, ResNet etc.
99

1010
# Installation
1111

@@ -140,6 +140,31 @@ The data is preprocessed [as described here](https://github.com/facebook/fb.resn
140140

141141
[Here is an example](https://github.com/pytorch/examples/blob/27e2a46c1d1505324032b1d94fc6ce24d5b67e97/imagenet/main.py#L48-L62).
142142

143+
# Models
144+
145+
The models subpackage contains definitions for the following model architectures:
146+
147+
- [AlexNet](https://arxiv.org/abs/1404.5997): AlexNet variant from the "One weird trick" paper.
148+
- [VGG](https://arxiv.org/abs/1409.1556): VGG-11, VGG-13, VGG-16, VGG-19 (with and without batch normalization)
149+
- [ResNet](https://arxiv.org/abs/1512.03385): ResNet-18, ResNet-34, ResNet-50, ResNet-101, ResNet-152
150+
151+
You can construct a model with random weights by calling its constructor:
152+
153+
```python
154+
import torchvision.models as models
155+
resnet18 = models.resnet18()
156+
alexnet = models.alexnet()
157+
```
158+
159+
We provide pre-trained models for the ResNet variants and AlexNet, using the
160+
PyTorch [model zoo](http://pytorch.org/docs/model_zoo.html). These can
161+
be constructed by passing `pretrained=True`:
162+
163+
```python
164+
import torchvision.models as models
165+
resnet18 = models.resnet18(pretrained=True)
166+
alexnet = models.alexnet(pretrained=True)
167+
```
143168

144169
# Transforms
145170

0 commit comments

Comments
 (0)