This document explains the major training arguments in train.py, including how to load different checkpoints and how to use each --training_mode option for multi-stage training.
parser.add_argument(
'--resume',
default='output_decoder_4_640/checkpoint-50.pth',
help='Pre-training ckpt for MAE (4-layer decoder)'
)Purpose Checkpoint for MAE pretraining, typically containing:
- Encoder
- 4-layer decoder
Use cases
- Initialize training from a pretrained MAE model
- Resume decoder-based training from a saved checkpoint
Notes
- Contains MAE + decoder only
- Usually does NOT include CFM or MFM weights
parser.add_argument(
'--fusion_weight',
default='path/to/fusion/layer/wegt',
help='Checkpoint for fusion layer (CFM only)'
)Purpose Checkpoint containing only fusion layers (CFM or MFM).
Notes
- Lightweight checkpoint
- Used when training CFM/MFM independently
parser.add_argument(
'--all_weight',
default='path/to/fusion/all/wegt',
help='Checkpoint for the entire model (decoder + CFM + MFM, etc.)'
)Purpose A full-model checkpoint, containing:
- Decoder
- CFM
- MFM
- Other related modules
Use cases
- Load as initialization for multi-stage training
- Fully restore model state from a previous training stage
Rule of thumb
--resume→ MAE / decoder checkpoint--fusion_weight→ fusion module only--all_weight→ full-model checkpoint for multi-stage loading
parser.add_argument(
'--training_mode',
default="train_decoder_CFM_MFM",
type=str,
choices=[
'train_CFM_mean',
'train_CFM_fusion',
'train_MFM_mean_CFM_lock',
'train_MFM_fusion_CFM_lock',
'train_MFM_mean_CFM_open',
'train_MFM_fusion_CFM_open',
'train_decoder_only',
'train_decoder_MFM',
'train_decoder_CFM_MFM',
]
)We consider three modules:
- Decoder — MAE decoder
- CFM — Fusion module
- MFM — Multi-feature module
Each mode controls:
- Which modules are trainable
- Whether CFM is locked or open
- Whether the loss is mean-based or fusion-based
Trainable
- CFM ✅
- Decoder ❌ (no use)
- MFM ❌ (no use)
Loss Mean-based feature loss.
Use case Simple initialization stage to stabilize CFM behavior.
Trainable
- CFM ✅
- Decoder ❌ (no use)
- MFM ❌ (no use)
Loss Fusion/pixel reconstruction loss via decoder (grad flows through decoder but decoder is not updated).
Use case Refine CFM with stronger supervision while keeping decoder stable.
Trainable
- Decoder ✅
- CFM ❌
- MFM ❌
Use case Pretrain decoder for strong reconstruction capability.
Trainable
- Decoder ✅
- MFM ✅
- CFM ❌
Loss Fusion-based loss.
Use case Train decoder and MFM jointly while keeping CFM frozen or unused.
Trainable
- Decoder ✅
- CFM ✅
- MFM ✅
Loss Fusion-based loss (pixel reconstruction, etc.)
Use case Final end-to-end joint fine-tuning after all modules are initialized.
Trainable
- MFM ✅
- CFM ❌ (locked)
Loss Mean-based loss.
Use case Train MFM only on top of a fixed CFM.
Trainable
- MFM ✅
- CFM ❌ (locked)
Loss Fusion/pixel reconstruction loss.
Use case Refine MFM under stronger task-oriented supervision.
Trainable
- MFM ✅
- CFM ✅
Loss Mean-based loss.
Use case Joint MFM + CFM training under a simpler objective.
Trainable
- MFM ✅
- CFM ✅
Loss Fusion/pixel reconstruction loss.
Use case
Strongest optimization stage for MFM + CFM; recommended after loading a good --all_weight checkpoint.