Package smile.vision

Class EfficientNet

All Implemented Interfaces:
Function<Tensor,Tensor>, Layer

public class EfficientNet extends LayerBlock
EfficientNet is an image classification model family. It was first described in EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks.
  • Constructor Details

    • EfficientNet

      public EfficientNet(MBConvConfig[] invertedResidualSetting, double dropout, double stochasticDepthProb, int numClasses, int lastChannel, IntFunction<Layer> normLayer)
      Constructor.
      Parameters:
      invertedResidualSetting - the network structure.
      dropout - the dropout probability.
      stochasticDepthProb - the stochastic depth probability.
      numClasses - the number of classes.
      lastChannel - the number of channels on the penultimate layer.
      normLayer - the functor to create the normalization layer.
  • Method Details

    • forward

      public Tensor forward(Tensor input)
      Description copied from interface: Layer
      Forward propagation (or forward pass) through the layer.
      Parameters:
      input - the input tensor.
      Returns:
      the output tensor.
    • features

      public SequentialBlock features()
      Returns the feature layer block.
      Returns:
      the feature layer block.
    • V2S

      public static VisionModel V2S()
      EfficientNet-V2_S (baseline) model.
      Returns:
      the model.
    • V2S

      public static VisionModel V2S(String path)
      EfficientNet-V2_S (baseline) model.
      Parameters:
      path - the pre-trained model file path.
      Returns:
      the model.
    • V2M

      public static VisionModel V2M()
      EfficientNet-V2_M (larger) model.
      Returns:
      the model.
    • V2M

      public static VisionModel V2M(String path)
      EfficientNet-V2_M (larger) model.
      Parameters:
      path - the pre-trained model file path.
      Returns:
      the model.
    • V2L

      public static VisionModel V2L()
      EfficientNet-V2_L (largest) model.
      Returns:
      the model.
    • V2L

      public static VisionModel V2L(String path)
      EfficientNet-V2_L (largest) model.
      Parameters:
      path - the pre-trained model file path.
      Returns:
      the model.