Record Class MBConvConfig

java.lang.Object
java.lang.Record
smile.vision.layer.MBConvConfig
Record Components:
expandRatio - the number of output channels of the first layer in each block is input channels times expansion ratio.
kernel - the window size.
stride - controls the stride for the cross-correlation.
inputChannels - the number of input channels.
outputChannels - the number of output channels.
numLayers - the number of layers.
block - the block type: "FusedMBConv" or "MBConv".

public record MBConvConfig(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, String block) extends Record
EfficientNet block configuration.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MBConvConfig(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, String block)
    Creates an instance of a MBConvConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the block record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    Returns the value of the expandRatio record component.
    FusedMBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers)
    Returns the config for Fused-MBConv block.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the inputChannels record component.
    int
    Returns the value of the kernel record component.
    MBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers)
    Returns the config for MBConv block.
    MBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, double widthMultiplier, double depthMultiplier)
    Returns the config for MBConv block.
    int
    Returns the value of the numLayers record component.
    int
    Returns the value of the outputChannels record component.
    int
    Returns the value of the stride record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MBConvConfig

      public MBConvConfig(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, String block)
      Creates an instance of a MBConvConfig record class.
      Parameters:
      expandRatio - the value for the expandRatio record component
      kernel - the value for the kernel record component
      stride - the value for the stride record component
      inputChannels - the value for the inputChannels record component
      outputChannels - the value for the outputChannels record component
      numLayers - the value for the numLayers record component
      block - the value for the block record component
  • Method Details

    • MBConv

      public static MBConvConfig MBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers)
      Returns the config for MBConv block.
      Parameters:
      expandRatio - the number of output channels of the first layer in each block is input channels times expansion ratio.
      kernel - the window size.
      stride - controls the stride for the cross-correlation.
      inputChannels - the number of input channels.
      outputChannels - the number of output channels.
      numLayers - the number of layers.
      Returns:
      the config for MBConv block.
    • MBConv

      public static MBConvConfig MBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, double widthMultiplier, double depthMultiplier)
      Returns the config for MBConv block.
      Parameters:
      expandRatio - the number of output channels of the first layer in each block is input channels times expansion ratio.
      kernel - the window size.
      stride - controls the stride for the cross-correlation.
      inputChannels - the number of input channels.
      outputChannels - the number of output channels.
      numLayers - the number of layers.
      widthMultiplier - the multiplier to scale input/output channels.
      depthMultiplier - the multiplier to scale number of layers.
      Returns:
      the config for MBConv block.
    • FusedMBConv

      public static MBConvConfig FusedMBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers)
      Returns the config for Fused-MBConv block.
      Parameters:
      expandRatio - the number of output channels of the first layer in each block is input channels times expansion ratio.
      kernel - the window size.
      stride - controls the stride for the cross-correlation.
      inputChannels - the number of input channels.
      outputChannels - the number of output channels.
      numLayers - the number of layers.
      Returns:
      the config for Fused-MBConv block.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • expandRatio

      public double expandRatio()
      Returns the value of the expandRatio record component.
      Returns:
      the value of the expandRatio record component
    • kernel

      public int kernel()
      Returns the value of the kernel record component.
      Returns:
      the value of the kernel record component
    • stride

      public int stride()
      Returns the value of the stride record component.
      Returns:
      the value of the stride record component
    • inputChannels

      public int inputChannels()
      Returns the value of the inputChannels record component.
      Returns:
      the value of the inputChannels record component
    • outputChannels

      public int outputChannels()
      Returns the value of the outputChannels record component.
      Returns:
      the value of the outputChannels record component
    • numLayers

      public int numLayers()
      Returns the value of the numLayers record component.
      Returns:
      the value of the numLayers record component
    • block

      public String block()
      Returns the value of the block record component.
      Returns:
      the value of the block record component