Configuration
thsolver uses yacs.config.CfgNode to define and merge experiment
configuration. The default tree lives in thsolver.config.
How Configuration Is Loaded
The command-line parser in thsolver.config.parse_args() supports:
--config path/to/file.yamlto load a configuration filea
BASEkey inside configuration files for hierarchical compositiontrailing key-value overrides such as
SOLVER.max_epoch 10
The parsed configuration is frozen before training starts, and the final merged
config is written to <logdir>/all_configs.yaml for reproducibility.
Top-Level Sections
The built-in tree contains these main sections:
SOLVERfor runtime, optimization, checkpointing, logging, and DDPDATA.trainandDATA.testfor dataset and dataloader settingsMODELfor model construction optionsLOSSfor task-specific loss configurationSYSfor bookkeeping such as the captured command line
Important SOLVER Fields
Some of the most frequently used options are:
SOLVER.run:train,test,evaluate, orprofileSOLVER.logdir: directory used for logs, checkpoints, and config backupsSOLVER.alias: optional suffix added tologdir; the wordtimeis replaced with the current timestampSOLVER.ckpt: checkpoint path to restore explicitlySOLVER.type: optimizer name, currentlysgd,adam, oradamwSOLVER.lr_type: scheduler strategy such asstep,cos,poly,constant, or warmup variantsSOLVER.best_val: metric selector such asmin:lossormax:accuSOLVER.amp_mode:none,fp16, orbf16SOLVER.ddp_mode:spawnortorchrun
Dataset Configuration
DATA.train and DATA.test share the same structure. Useful fields include:
name: dataset factory name used bythsolver.registry.build_dataset()location: dataset root directoryfilelist: text file describing samplesbatch_sizeandnum_workers: dataloader settingsshuffle: whether the infinite sampler should randomize sample ordertake: limit the number of examples for quick experimentsdisable: skip the train or test dataloader entirely
The built-in thsolver.dataset.Dataset expects a filelist where each
line contains a relative filename and an optional integer label.
Example Override
python train.py --config configs/experiment.yaml \
SOLVER.alias debug \
SOLVER.max_epoch 5 \
DATA.train.take 64