Package smile.vision.layer
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
ConstructorsConstructorDescriptionMBConvConfig(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, String block) Creates an instance of aMBConvConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionblock()Returns the value of theblockrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of theexpandRatiorecord component.static MBConvConfigFusedMBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers) Returns the config for Fused-MBConv block.final inthashCode()Returns a hash code value for this object.intReturns the value of theinputChannelsrecord component.intkernel()Returns the value of thekernelrecord component.static MBConvConfigMBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers) Returns the config for MBConv block.static MBConvConfigMBConv(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, double widthMultiplier, double depthMultiplier) Returns the config for MBConv block.intReturns the value of thenumLayersrecord component.intReturns the value of theoutputChannelsrecord component.intstride()Returns the value of thestriderecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MBConvConfig
public MBConvConfig(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, String block) Creates an instance of aMBConvConfigrecord class.- Parameters:
expandRatio- the value for theexpandRatiorecord componentkernel- the value for thekernelrecord componentstride- the value for thestriderecord componentinputChannels- the value for theinputChannelsrecord componentoutputChannels- the value for theoutputChannelsrecord componentnumLayers- the value for thenumLayersrecord componentblock- the value for theblockrecord 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
expandRatio
public double expandRatio()Returns the value of theexpandRatiorecord component.- Returns:
- the value of the
expandRatiorecord component
-
kernel
public int kernel()Returns the value of thekernelrecord component.- Returns:
- the value of the
kernelrecord component
-
stride
public int stride()Returns the value of thestriderecord component.- Returns:
- the value of the
striderecord component
-
inputChannels
public int inputChannels()Returns the value of theinputChannelsrecord component.- Returns:
- the value of the
inputChannelsrecord component
-
outputChannels
public int outputChannels()Returns the value of theoutputChannelsrecord component.- Returns:
- the value of the
outputChannelsrecord component
-
numLayers
public int numLayers()Returns the value of thenumLayersrecord component.- Returns:
- the value of the
numLayersrecord component
-
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-