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
ConstructorDescriptionMBConvConfig
(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers, String block) Creates an instance of aMBConvConfig
record class. -
Method Summary
Modifier and TypeMethodDescriptionblock()
Returns the value of theblock
record component.final boolean
Indicates whether some other object is "equal to" this one.double
Returns the value of theexpandRatio
record component.static MBConvConfig
FusedMBConv
(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers) Returns the config for Fused-MBConv block.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of theinputChannels
record component.int
kernel()
Returns the value of thekernel
record component.static MBConvConfig
MBConv
(double expandRatio, int kernel, int stride, int inputChannels, int outputChannels, int numLayers) Returns the config for MBConv block.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.int
Returns the value of thenumLayers
record component.int
Returns the value of theoutputChannels
record component.int
stride()
Returns the value of thestride
record component.final String
toString()
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 aMBConvConfig
record class.- Parameters:
expandRatio
- the value for theexpandRatio
record componentkernel
- the value for thekernel
record componentstride
- the value for thestride
record componentinputChannels
- the value for theinputChannels
record componentoutputChannels
- the value for theoutputChannels
record componentnumLayers
- the value for thenumLayers
record componentblock
- the value for theblock
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
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 theexpandRatio
record component.- Returns:
- the value of the
expandRatio
record component
-
kernel
public int kernel()Returns the value of thekernel
record component.- Returns:
- the value of the
kernel
record component
-
stride
public int stride()Returns the value of thestride
record component.- Returns:
- the value of the
stride
record component
-
inputChannels
public int inputChannels()Returns the value of theinputChannels
record component.- Returns:
- the value of the
inputChannels
record component
-
outputChannels
public int outputChannels()Returns the value of theoutputChannels
record component.- Returns:
- the value of the
outputChannels
record component
-
numLayers
public int numLayers()Returns the value of thenumLayers
record component.- Returns:
- the value of the
numLayers
record component
-
block
Returns the value of theblock
record component.- Returns:
- the value of the
block
record component
-