jittor.models¶
这里是Jittor的骨干网络模块的API文档,您可以通过from jittor import models
来获取该模块。
- class jittor.models.AlexNet(num_classes=1000)[源代码]¶
AlexNet model architecture.
Args:
num_classes: Number of classes. Default: 1000.
Example:
model = jittor.models.AlexNet(500) x = jittor.random([10,3,224,224]) y = model(x) # [10, 500]
- class jittor.models.DenseNet(growth_rate=32, block_config=(6, 12, 24, 16), num_init_features=64, bn_size=4, drop_rate=0, num_classes=1000)[源代码]¶
Densenet-BC model class, based on “Densely Connected Convolutional Networks”
- Args:
growth_rate (int) - how many filters to add each layer (k in paper) block_config (list of 4 ints) - how many layers in each pooling block num_init_features (int) - the number of filters to learn in the first convolution layer bn_size (int) - multiplicative factor for number of bottle neck layers
(i.e. bn_size * k features in the bottleneck layer)
drop_rate (float) - dropout rate after each dense layer num_classes (int) - number of classification classes
- class jittor.models.GoogLeNet(num_classes=1000, aux_logits=True, init_weights=True, blocks=None)[源代码]¶
GoogLeNet model architecture.
Args:
num_classes: Number of classes. Default: 1000.
aux_logits: If True, add an auxiliary branch that can improve training. Default: True
init_weights: Defualt: True.
blocks: List of three blocks, [conv_block, inception_block, inception_aux_block]. If None, will use [BasicConv2d, Inception, InceptionAux] instead. Default: None.
- class jittor.models.Inception3(num_classes=1000, aux_logits=True, inception_blocks=None, init_weights=True)[源代码]¶
Inceptionv3 model architecture.
Args:
num_classes: Number of classes. Default: 1000.
aux_logits: If True, add an auxiliary branch that can improve training. Default: True
inception_blocks: List of seven blocks, [conv_block, inception_a, inception_b, inception_c, inception_d, inception_e, inception_aux]. If None, will use [BasicConv2d, InceptionA, InceptionB, InceptionC, InceptionD, InceptionE, InceptionAux] instead. Default: None.
init_weights: Defualt: True.
- class jittor.models.MNASNet(alpha, num_classes=1000, dropout=0.2)[源代码]¶
MNASNet model architecture. version=2.
Args:
alpha: Depth multiplier.
num_classes: Number of classes. Default: 1000.
dropout: Dropout probability of dropout layer.
- class jittor.models.MobileNetV2(num_classes=1000, width_mult=1.0, inverted_residual_setting=None, round_nearest=8, block=None)[源代码]¶
MobileNetV2 model architecture.
Args:
num_classes: Number of classes. Default: 1000.
width_mult: Width multiplier - adjusts number of channels in each layer by this amount. Default: 1.0.
init_weights: Defualt: True.
inverted_residual_setting: Network structure
round_nearest: Round the number of channels in each layer to be a multiple of this number. Set to 1 to turn off rounding. Default: 8.
block: Module specifying inverted residual building block for mobilenet. If None, use InvertedResidual instead. Default: None.
- class jittor.models.OrderedDict[源代码]¶
Dictionary that remembers insertion order
- clear() None. Remove all items from od. ¶
- copy() a shallow copy of od ¶
- fromkeys(value=None)¶
Create a new ordered dictionary with keys from iterable and values set to value.
- items() a set-like object providing a view on D’s items ¶
- keys() a set-like object providing a view on D’s keys ¶
- move_to_end(key, last=True)¶
Move an existing element to the end (or beginning if last is false).
Raise KeyError if the element does not exist.
- pop(k[, d]) v, remove specified key and return the corresponding ¶
value. If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem(last=True)¶
Remove and return a (key, value) pair from the dictionary.
Pairs are returned in LIFO order if last is true or FIFO order if false.
- setdefault(key, default=None)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F. ¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D’s values ¶
- jittor.models.Resnet101(pretrained=False, **kwargs)[源代码]¶
ResNet-101 model architecture.
Example:
model = jittor.models.Resnet101() x = jittor.random([10,3,224,224]) y = model(x) # [10, 1000]
- jittor.models.densenet121(pretrained=False, **kwargs)[源代码]¶
Densenet-121 model from “Densely Connected Convolutional Networks”
- Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
- jittor.models.densenet161(pretrained=False, **kwargs)[源代码]¶
Densenet-161 model from “Densely Connected Convolutional Networks”
- Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
- jittor.models.densenet169(pretrained=False, **kwargs)[源代码]¶
Densenet-169 model from “Densely Connected Convolutional Networks”
- Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
- jittor.models.densenet201(pretrained=False, **kwargs)[源代码]¶
Densenet-201 model from “Densely Connected Convolutional Networks”
- Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
- jittor.models.res2net101(pretrained=False, **kwargs)¶
Constructs a Res2Net-50_26w_4s model. Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
- jittor.models.res2net50(pretrained=False, **kwargs)[源代码]¶
Constructs a Res2Net-50 model. Res2Net-50 refers to the Res2Net-50_26w_4s. Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
- jittor.models.resnet101(pretrained=False, **kwargs)¶
ResNet-101 model architecture.
Example:
model = jittor.models.Resnet101() x = jittor.random([10,3,224,224]) y = model(x) # [10, 1000]
- jittor.models.resnet152(pretrained=False, **kwargs)¶
- jittor.models.resnet18(pretrained=False, **kwargs)¶
- jittor.models.resnet26(pretrained=False, **kwargs)¶
- jittor.models.resnet34(pretrained=False, **kwargs)¶
- jittor.models.resnet38(pretrained=False, **kwargs)¶
- jittor.models.resnet50(pretrained=False, **kwargs)¶
- jittor.models.resnext101_32x8d(pretrained=False, **kwargs)¶
- jittor.models.resnext50_32x4d(pretrained=False, **kwargs)¶
- jittor.models.wide_resnet101_2(pretrained=False, **kwargs)¶
- jittor.models.wide_resnet50_2(pretrained=False, **kwargs)¶