java.lang.Object
ai.djl.basicmodelzoo.cv.classification.NiN

public final class NiN extends 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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    The Builder to construct a NiN object.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a builder to build a NiN.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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 - the NiN.Builder with the necessary arguments.
      Returns:
      a NiN block.
    • builder

      public static NiN.Builder builder()
      Creates a builder to build a NiN.
      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.