mstar.model.command_a_plus.components.vision#
Command A+’s image encoder: a SigLIP tower, a pixel shuffle and a SwiGLU projector.
Tiles are all image_size square, so they batch as plain [tiles, patches, width].
Classes
|
Merges each |
|
Image tiles in, one LLM-width embedding per |
|
|
|
|
|
|
|
- class mstar.model.command_a_plus.components.vision.CommandAPlusProjector(config, text_hidden_size)[source]#
Bases:
ModuleMerges each
downsample_factor-square block of patches into one LLM token.- Parameters:
config (CommandAPlusVisionConfig)
text_hidden_size (int)
- forward(x)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class mstar.model.command_a_plus.components.vision.CommandAPlusVisionEncoder(config, text_hidden_size)[source]#
Bases:
ModuleImage tiles in, one LLM-width embedding per
<|IMG_PATCH|>token out.- Parameters:
config (CommandAPlusVisionConfig)
text_hidden_size (int)
- class mstar.model.command_a_plus.components.vision.SiglipAttention(config)[source]#
Bases:
Module- Parameters:
config (CommandAPlusVisionConfig)
- forward(x)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class mstar.model.command_a_plus.components.vision.SiglipEmbeddings(config)[source]#
Bases:
Module- Parameters:
config (CommandAPlusVisionConfig)
- forward(pixel_values)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class mstar.model.command_a_plus.components.vision.SiglipLayer(config)[source]#
Bases:
Module- Parameters:
config (CommandAPlusVisionConfig)
- forward(x)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class mstar.model.command_a_plus.components.vision.SiglipMLP(config)[source]#
Bases:
Module- Parameters:
config (CommandAPlusVisionConfig)
- forward(x)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.