Class ResNetV1
java.lang.Object
ai.djl.basicmodelzoo.cv.classification.ResNetV1
ResNetV1 contains a generic implementation of ResNet adapted from
https://github.com/tornadomeet/ResNet/blob/master/symbol_resnet.py (Original author Wei Wu) by
Antti-Pekka Hynninen.
Implementing the original resnet ILSVRC 2015 winning network from Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun. "Deep Residual Learning for Image Recognition"
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ResNetV1.Builderbuilder()Creates a builder to build aResNetV1.static ai.djl.nn.BlockresidualUnit(int numFilters, ai.djl.ndarray.types.Shape stride, boolean dimMatch, boolean bottleneck, float batchNormMomentum) Builds aBlockthat represents a residual unit used in the implementation of the Resnet model.static ai.djl.nn.SequentialBlockresnet(ResNetV1.Builder builder)
-
Method Details
-
residualUnit
public static ai.djl.nn.Block residualUnit(int numFilters, ai.djl.ndarray.types.Shape stride, boolean dimMatch, boolean bottleneck, float batchNormMomentum) Builds aBlockthat represents a residual unit used in the implementation of the Resnet model.- Parameters:
numFilters- the number of output channelsstride- the stride of the convolution in each dimensiondimMatch- whether the number of channels between input and output has to remain the samebottleneck- whether to use bottleneck architecturebatchNormMomentum- the momentum to be used forBatchNorm- Returns:
- a
Blockthat represents a residual unit
-
resnet
- Parameters:
builder- theResNetV1.Builderwith the necessary arguments- Returns:
- a
Blockthat represents the required ResNet model
-
builder
Creates a builder to build aResNetV1.- Returns:
- a new builder
-