from fastai.gen_doc.nbdoc import *
from fastai.vision.models.darknet import Darknet
from fastai.vision.models.wrn import wrn_22, WideResNet
The fastai library includes several pretrained models from torchvision, namely:
On top of the models offered by torchvision, fastai has implementations for the following models:
models.unet
show_doc(Darknet)
class
Darknet
[source][test]
Darknet
(num_blocks
:Collection
[int
],num_classes
:int
,nf
=*32
*) ::PrePostInitMeta
::Module
No tests found for Darknet
. To contribute a test please refer to this guide and this discussion.
Create a Darknet with blocks of sizes given in num_blocks
, ending with num_classes
and using nf
initial features. Darknet53 uses num_blocks = [1,2,8,8,4]
.
show_doc(WideResNet)
class
WideResNet
[source][test]
WideResNet
(num_groups
:int
,N
:int
,num_classes
:int
,k
:int
=*1
,drop_p
:float
=0.0
,start_nf
:int
=16
,n_in_channels
:int
=3
*) ::PrePostInitMeta
::Module
No tests found for WideResNet
. To contribute a test please refer to this guide and this discussion.
Wide ResNet with num_groups
and a width of k
.
Each group contains N
blocks. start_nf
the initial number of features. Dropout of drop_p
is applied in between the two convolutions in each block. The expected input channel size is fixed at 3.
Structure: initial convolution -> num_groups
x N
blocks -> final layers of regularization and pooling
The first block of each group joins a path containing 2 convolutions with filter size 3x3 (and various regularizations) with another path containing a single convolution with a filter size of 1x1. All other blocks in each group follow the more traditional res_block style, i.e., the input of the path with two convs is added to the output of that path.
In the first group the stride is 1 for all convolutions. In all subsequent groups the stride in the first convolution of the first block is 2 and then all following convolutions have a stride of 1. Padding is always 1.
show_doc(wrn_22)
wrn_22
[source][test]
wrn_22
()
No tests found for wrn_22
. To contribute a test please refer to this guide and this discussion.
Wide ResNet with 22 layers.
This is a WideResNet
with num_groups=3
, N=3
, k=6
and drop_p=0.
.