Class MobileNetV2
- java.lang.Object
-
- ai.djl.basicmodelzoo.cv.classification.MobileNetV2
-
public final class MobileNetV2 extends java.lang.ObjectMobileNetV2contains a generic implementation of MobilenetV2 adapted from https://github.com/weiaicunzai/pytorch-cifar100/blob/master/models/mobilenetv2.py (Original author weiaicunzai).see https://arxiv.org/pdf/1801.04381.pdf for more information about MobileNetV2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMobileNetV2.BuilderThe Builder to construct aMobileNetV2object.
-
Field Summary
Fields Modifier and Type Field Description static intFILTERLENGTHstatic intMULTILENGTHstatic intREPEATLENGTHstatic intSTRIDELENGTH
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MobileNetV2.Builderbuilder()Creates a builder to build aMobileNetV2.static ai.djl.nn.BlocklinearBottleNeck(int inputChannels, int outputChannels, int stride, int t, float batchNormMomentum)Builds aBlockthat represent an inverted residual Unit used in the implementation of the MobileNetV2 Model.static ai.djl.nn.BlockmakeStage(int repeat, int inputChannels, int outputChannels, int stride, int t, float batchNormMomentum)Builds aBlockthat represent multiple repeats of an inverted residual Unit.static ai.djl.nn.BlockmobilenetV2(MobileNetV2.Builder builder)
-
-
-
Field Detail
-
FILTERLENGTH
public static final int FILTERLENGTH
- See Also:
- Constant Field Values
-
REPEATLENGTH
public static final int REPEATLENGTH
- See Also:
- Constant Field Values
-
STRIDELENGTH
public static final int STRIDELENGTH
- See Also:
- Constant Field Values
-
MULTILENGTH
public static final int MULTILENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
linearBottleNeck
public static ai.djl.nn.Block linearBottleNeck(int inputChannels, int outputChannels, int stride, int t, float batchNormMomentum)Builds aBlockthat represent an inverted residual Unit used in the implementation of the MobileNetV2 Model.- Parameters:
inputChannels- number of inputChannels of the blockoutputChannels- number of outputChannels of the blockstride- control the stride of a depthWise kernelt- the multiTime of the first pointWise BlockbatchNormMomentum- the momentum of batchNormLayer- Returns:
- a
Blockthat represent an inverted residual Unit
-
makeStage
public static ai.djl.nn.Block makeStage(int repeat, int inputChannels, int outputChannels, int stride, int t, float batchNormMomentum)Builds aBlockthat represent multiple repeats of an inverted residual Unit.- Parameters:
repeat- the repeatTimes of an inverted residual BlockinputChannels- number of inputChannels of the blockoutputChannels- number of outputChannels of the blockstride- the stride of an inverted residual Unitt- the multipleTime of a pointWise KernelbatchNormMomentum- the momentum of batchNormLayer- Returns:
- a
Blockthat represent several repeated inverted residual Units
-
mobilenetV2
public static ai.djl.nn.Block mobilenetV2(MobileNetV2.Builder builder)
- Parameters:
builder- theMobileNetV2.Builderwith the necessary arguments- Returns:
- a
Blockthat represents the required MobileNetV2 model
-
builder
public static MobileNetV2.Builder builder()
Creates a builder to build aMobileNetV2.- Returns:
- a new builder
-
-