TorchLean API

NN.API.Models.Cnn

Convolutional Classifier #

The classifier accepts any batchShape and number of spatial axes. Convolution and pooling use the same vector-valued configuration for signals, images, volumes, and higher-dimensional data.

Configuration for a convolutional classifier over d spatial axes.

  • inputChannels :

    Number of channels in each input sample.

  • spatial : Tensor [d]

    Extent of each spatial axis.

  • convolution : Convolution.Config d

    Convolution applied before activation and pooling.

  • pooling : Pooling.Config d

    Pooling applied after the convolutional activation.

  • classCount :

    Number of classifier logits per sample.

Instances For

    Validate the complete classifier geometry before allocating convolution or head parameters.

    Instances For
      @[reducible, inline]
      abbrev TorchLean.nn.models.CNN.Config.inputShape {d : } (config : Config d) (batchShape : Shape := []) :

      Input tensor shape after prepending an arbitrary batch shape.

      Instances For
        @[reducible, inline]
        abbrev TorchLean.nn.models.CNN.Config.outputShape {d : } (config : Config d) (batchShape : Shape := []) :

        Classifier output shape with the same batch shape as the input.

        Instances For
          def TorchLean.nn.models.cnn {d : } (config : CNN.Config d) (batchShape : Shape := []) :
          Builder (Sequential (config.inputShape batchShape) (config.outputShape batchShape))

          Build convolution -> activation -> max pool -> flatten -> linear.

          Instances For