Record Class MiniMaxVisionArgs
java.lang.Object
java.lang.Record
smile.llm.model.minimax.MiniMaxVisionArgs
- Record Components:
- ViT width.numHeads- attention heads.numLayers- encoder layers.intermediateSize- MLP width.patchSize- spatial patch edge in pixels.temporalPatchSize- frames folded into one patch.mergeSize- spatial merge factor (merge x merge patches become one token).numChannels- input channels.layerNormEps- LayerNorm epsilon.ropeTheta- 3D RoPE base.maxSegmentFrames- attention never spans more than this many temporal groups (longer grids are split).textHidden- width of the language model embeddings (projector output).projectorHidden- projector / merger hidden width.imageTokenId- placeholder token id of image patches.videoTokenId- placeholder token id of video patches.
public record MiniMaxVisionArgs(int hiddenSize, int numHeads, int numLayers, int intermediateSize, int patchSize, int temporalPatchSize, int mergeSize, int numChannels, double layerNormEps, double ropeTheta, int maxSegmentFrames, int textHidden, int projectorHidden, int imageTokenId, int videoTokenId)
extends Record
Hyperparameters of the MiniMax-M3 vision encoder (CLIP-style ViT with 3D RoPE), the projector and the
2x2 patch merger, read from
vision_config of config.json.-
Constructor Summary
ConstructorsConstructorDescriptionMiniMaxVisionArgs(int hiddenSize, int numHeads, int numLayers, int intermediateSize, int patchSize, int temporalPatchSize, int mergeSize, int numChannels, double layerNormEps, double ropeTheta, int maxSegmentFrames, int textHidden, int projectorHidden, int imageTokenId, int videoTokenId) Creates an instance of aMiniMaxVisionArgsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintaxisDim()Returns the rotary dimensions per axis (t, h, w each get this many).final booleanIndicates whether some other object is "equal to" this one.static MiniMaxVisionArgsfromConfig(tools.jackson.databind.JsonNode root) Parses the top-level config object.static MiniMaxVisionArgsfromConfigFile(File configFile) Parses a checkpoint'sconfig.json.final inthashCode()Returns a hash code value for this object.intheadDim()Returns the per-head width.intReturns the value of thehiddenSizerecord component.intReturns the value of theimageTokenIdrecord component.intReturns the value of theintermediateSizerecord component.doubleReturns the value of thelayerNormEpsrecord component.intReturns the value of themaxSegmentFramesrecord component.intReturns the value of themergeSizerecord component.intReturns the value of thenumChannelsrecord component.intnumHeads()Returns the value of thenumHeadsrecord component.intReturns the value of thenumLayersrecord component.intpatchDim()Returns the length of one flattened patch (C * T * P * P).intReturns the value of thepatchSizerecord component.intReturns the value of theprojectorHiddenrecord component.doubleReturns the value of theropeThetarecord component.intReturns the rotated dimensions of each head (3 * axisDim); the remaining head dims pass through.intReturns the value of thetemporalPatchSizerecord component.intReturns the value of thetextHiddenrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thevideoTokenIdrecord component.
-
Constructor Details
-
MiniMaxVisionArgs
public MiniMaxVisionArgs(int hiddenSize, int numHeads, int numLayers, int intermediateSize, int patchSize, int temporalPatchSize, int mergeSize, int numChannels, double layerNormEps, double ropeTheta, int maxSegmentFrames, int textHidden, int projectorHidden, int imageTokenId, int videoTokenId) Creates an instance of aMiniMaxVisionArgsrecord class.- Parameters:
hiddenSize- the value for thehiddenSizerecord componentnumHeads- the value for thenumHeadsrecord componentnumLayers- the value for thenumLayersrecord componentintermediateSize- the value for theintermediateSizerecord componentpatchSize- the value for thepatchSizerecord componenttemporalPatchSize- the value for thetemporalPatchSizerecord componentmergeSize- the value for themergeSizerecord componentnumChannels- the value for thenumChannelsrecord componentlayerNormEps- the value for thelayerNormEpsrecord componentropeTheta- the value for theropeThetarecord componentmaxSegmentFrames- the value for themaxSegmentFramesrecord componenttextHidden- the value for thetextHiddenrecord componentprojectorHidden- the value for theprojectorHiddenrecord componentimageTokenId- the value for theimageTokenIdrecord componentvideoTokenId- the value for thevideoTokenIdrecord component
-
-
Method Details
-
headDim
public int headDim()Returns the per-head width.- Returns:
- per-head width.
-
patchDim
public int patchDim()Returns the length of one flattened patch (C * T * P * P).- Returns:
- length of one flattened patch (
C * T * P * P).
-
axisDim
public int axisDim()Returns the rotary dimensions per axis (t, h, w each get this many).- Returns:
- rotary dimensions per axis (t, h, w each get this many).
-
rotaryDim
public int rotaryDim()Returns the rotated dimensions of each head (3 * axisDim); the remaining head dims pass through.- Returns:
- rotated dimensions of each head (
3 * axisDim); the remaining head dims pass through.
-
fromConfigFile
Parses a checkpoint'sconfig.json.- Parameters:
configFile- the file.- Returns:
- the vision arguments, or
nullwhen the config has novision_config. - Throws:
IOException- if the file cannot be read.
-
fromConfig
Parses the top-level config object.- Parameters:
root- the parsedconfig.json.- Returns:
- the vision arguments, or
nullwhen there is novision_config.
-
toString
-
hashCode
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
numHeads
-
numLayers
-
intermediateSize
public int intermediateSize()Returns the value of theintermediateSizerecord component.- Returns:
- the value of the
intermediateSizerecord component
-
patchSize
-
temporalPatchSize
public int temporalPatchSize()Returns the value of thetemporalPatchSizerecord component.- Returns:
- the value of the
temporalPatchSizerecord component
-
mergeSize
-
numChannels
public int numChannels()Returns the value of thenumChannelsrecord component.- Returns:
- the value of the
numChannelsrecord component
-
layerNormEps
public double layerNormEps()Returns the value of thelayerNormEpsrecord component.- Returns:
- the value of the
layerNormEpsrecord component
-
ropeTheta
-
maxSegmentFrames
public int maxSegmentFrames()Returns the value of themaxSegmentFramesrecord component.- Returns:
- the value of the
maxSegmentFramesrecord component
-
textHidden
public int textHidden()Returns the value of thetextHiddenrecord component.- Returns:
- the value of the
textHiddenrecord component
-
projectorHidden
public int projectorHidden()Returns the value of theprojectorHiddenrecord component.- Returns:
- the value of the
projectorHiddenrecord component
-
imageTokenId
public int imageTokenId()Returns the value of theimageTokenIdrecord component.- Returns:
- the value of the
imageTokenIdrecord component
-
videoTokenId
public int videoTokenId()Returns the value of thevideoTokenIdrecord component.- Returns:
- the value of the
videoTokenIdrecord component
-