Class NiN
- java.lang.Object
-
- ai.djl.basicmodelzoo.cv.classification.NiN
-
public final class NiN extends java.lang.Object
NiN uses convolutional layers with window shapes of 11×11 , 5×5 , and 3×3 , and the corresponding numbers of output channels are the same as in AlexNet. Each NiN block is followed by a maximum pooling layer with a stride of 2 and a window shape of 3×3 .The conventional convolutional layer uses linear filters followed by a nonlinear activation function to scan the input.
NiN model from the "Network In Network" http://arxiv.org/abs/1312.4400 paper.
- See Also:
- The D2L chapter on NiN
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NiN.Builder
The Builder to construct aNiN
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NiN.Builder
builder()
Creates a builder to build aNiN
.static ai.djl.nn.Block
niN(NiN.Builder builder)
The NiN block consists of one convolutional layer followed by two 1×1 convolutional layers that act as per-pixel fully-connected layers with ReLU activations.ai.djl.nn.SequentialBlock
niNBlock(int numChannels, ai.djl.ndarray.types.Shape kernelShape, ai.djl.ndarray.types.Shape strideShape, ai.djl.ndarray.types.Shape paddingShape)
Creates a constituent NiN block that becomes a part of the whole NiN model.
-
-
-
Method Detail
-
niN
public static ai.djl.nn.Block niN(NiN.Builder builder)
The NiN block consists of one convolutional layer followed by two 1×1 convolutional layers that act as per-pixel fully-connected layers with ReLU activations. The convolution width of the first layer is typically set by the user. The subsequent widths are fixed to 1×1.- Parameters:
builder
- theNiN.Builder
with the necessary arguments.- Returns:
- a NiN block.
-
builder
public static NiN.Builder builder()
Creates a builder to build aNiN
.- Returns:
- a new builder
-
niNBlock
public ai.djl.nn.SequentialBlock niNBlock(int numChannels, ai.djl.ndarray.types.Shape kernelShape, ai.djl.ndarray.types.Shape strideShape, ai.djl.ndarray.types.Shape paddingShape)
Creates a constituent NiN block that becomes a part of the whole NiN model.- Parameters:
numChannels
- the number of channels in a NiN block.kernelShape
- kernel Shape in the 1st convolutional layer of a NiN block.strideShape
- stride Shape in a NiN block.paddingShape
- padding Shape in a NiN block.- Returns:
- a constituent niN block.
-
-