Class MobileNetV1
java.lang.Object
ai.djl.basicmodelzoo.cv.classification.MobileNetV1
MobileNetV1 contains a generic implementation of Mobilenet adapted from
https://github.com/weiaicunzai/pytorch-cifar100/blob/master/models/mobilenet.py (Original author
weiaicunzai).
see https://arxiv.org/pdf/1704.04861.pdf for more information about MobileNet
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe Builder to construct aMobileNetV1object. -
Method Summary
Modifier and TypeMethodDescriptionstatic MobileNetV1.Builderbuilder()Creates a builder to build aMobileNetV1.static ai.djl.nn.BlockdepthSeparableConv2d(int inputChannels, int outputChannels, int stride, MobileNetV1.Builder builder) Builds aBlockthat represent a depthWise-pointWise Unit used in the implementation of the MobileNet Model.static ai.djl.nn.Blockmobilenet(MobileNetV1.Builder builder)
-
Method Details
-
depthSeparableConv2d
public static ai.djl.nn.Block depthSeparableConv2d(int inputChannels, int outputChannels, int stride, MobileNetV1.Builder builder) Builds aBlockthat represent a depthWise-pointWise Unit used in the implementation of the MobileNet Model.- Parameters:
inputChannels- number of inputChannels, used for depthWise KerneloutputChannels- number of outputChannels, used for pointWise kernelstride- control the stride of depthWise Kernelbuilder- add the builder to obtain batchNormMomentum- Returns:
- a
Blockthat represent a depthWise-pointWise Unit
-
mobilenet
- Parameters:
builder- theMobileNetV1.Builderwith the necessary arguments- Returns:
- a
Blockthat represents the required MobileNet model
-
builder
Creates a builder to build aMobileNetV1.- Returns:
- a new builder
-