API Reference: Classification Models
TensorNets provides a rich collection of pre-trained models for image classification. All models share a consistent functional API.
Common Signature
Each classification model follows this general signature:
def ModelName(inputs, is_training=False, classes=1000, stem=False, scope=None, reuse=None):
inputs: Atf.Tensorrepresenting the batch of input images.is_training: A booleanTensoror a Python boolean. Controls behavior for layers like Batch Normalization and Dropout. Defaults toFalse.classes: The number of output classes for the final layer. Defaults to1000for ImageNet.stem: IfTrue, the model returns the output of the convolutional base (the feature extractor) before the final classification layer. This is useful for transfer learning. Defaults toFalse.scope: A string for thetf.variable_scope.reuse: A boolean for reusing variables within the scope.
Available Models
Below is a list of the available image classification models, grouped by their architectural family.
| Model Family | Model Name | Source File |
|---|---|---|
| CapsuleNet | CapsuleNet |
tensornets/capsulenets.py |
| Darknet | Darknet19 |
tensornets/darknets.py |
TinyDarknet19 |
tensornets/darknets.py |
|
| DenseNet | DenseNet121 |
tensornets/densenets.py |
DenseNet169 |
tensornets/densenets.py |
|
DenseNet201 |
tensornets/densenets.py |
|
| EfficientNet | EfficientNetB0 - B7 |
tensornets/efficientnets.py |
| Inception | Inception1 (GoogLeNet) |
tensornets/inceptions.py |
Inception2 |
tensornets/inceptions.py |
|
Inception3 |
tensornets/inceptions.py |
|
Inception4 |
tensornets/inceptions.py |
|
InceptionResNet2 |
tensornets/inceptions.py |
|
| MobileNet | MobileNet25, 50, 75, 100 |
tensornets/mobilenets.py |
MobileNet35v2 - 140v2 |
tensornets/mobilenets.py |
|
MobileNet75v3large, 100v3large |
tensornets/mobilenets.py |
|
MobileNet75v3small, 100v3small |
tensornets/mobilenets.py |
|
| NASNet | NASNetAlarge |
tensornets/nasnets.py |
NASNetAmobile |
tensornets/nasnets.py |
|
PNASNetlarge |
tensornets/nasnets.py |
|
| ResNet | ResNet50, 101, 152 |
tensornets/resnets.py |
ResNet50v2, 101v2, 152v2, 200v2 |
tensornets/resnets.py |
|
| ResNeXt | ResNeXt50, 101, 50c32, 101c32, 101c64 |
tensornets/resnets.py |
| SqueezeNet | SqueezeNet |
tensornets/squeezenets.py |
| VGG | VGG16, VGG19 |
tensornets/vggs.py |
| WaveNet | WaveNet |
tensornets/wavenets.py |
| WideResNet | WideResNet50 |
tensornets/resnets.py |
| ZFNet | ZF |
tensornets/zf.py |