Class MobileNetV1
- java.lang.Object
-
- ai.djl.basicmodelzoo.cv.classification.MobileNetV1
-
public final class MobileNetV1 extends java.lang.Object
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 Classes Modifier and Type Class Description static class
MobileNetV1.Builder
The Builder to construct aMobileNetV1
object.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MobileNetV1.Builder
builder()
Creates a builder to build aMobileNetV1
.static ai.djl.nn.Block
depthSeparableConv2d(int inputChannels, int outputChannels, int stride, MobileNetV1.Builder builder)
Builds aBlock
that represent a depthWise-pointWise Unit used in the implementation of the MobileNet Model.static ai.djl.nn.Block
mobilenet(MobileNetV1.Builder builder)
-
-
-
Method Detail
-
depthSeparableConv2d
public static ai.djl.nn.Block depthSeparableConv2d(int inputChannels, int outputChannels, int stride, MobileNetV1.Builder builder)
Builds aBlock
that 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
Block
that represent a depthWise-pointWise Unit
-
mobilenet
public static ai.djl.nn.Block mobilenet(MobileNetV1.Builder builder)
- Parameters:
builder
- theMobileNetV1.Builder
with the necessary arguments- Returns:
- a
Block
that represents the required MobileNet model
-
builder
public static MobileNetV1.Builder builder()
Creates a builder to build aMobileNetV1
.- Returns:
- a new builder
-
-