sakura.model_controllers.extractor_controller.ExtractorController
- class sakura.model_controllers.extractor_controller.ExtractorController(model: Extractor, config: dict | None = None, pheno_config: dict | None = None, signature_config: dict | None = None, verbose=False)
Bases:
objectCentral controller class managing the complete training lifecycle of the Extractor model
This class provides the core controller for the Extractor model. It handles multi-component loss calculation, dynamic weight adjustment, distributed regularization, and training workflow management.
- Parameters:
model (models.Extractor) – Extractor model
config (dict, optional) – experiment configuration dict
pheno_config (dict, optional) – phenotype supervision configuration
signature_config (dict, optional) – signature supervision configuration
verbose (bool, optional) – Whether to enable verbose console logging, defaults to False
Methods
Evaluate the model using the specified batch of data.
Restore training state of the extractor from given checkpoint.
Calculate composite loss across all active components.
Handle inter epoch loss weight progressions and tick epoch counters.
Print the projected weights for main latent, phenotype, and signature groups over the expected epochs.
Handle regularization to the given tensor based on the specified configuration.
Reset the trainer's state.
Save the current training state of the extractor.
Utility method to handle selections from internal phenotype/signature configs.
Select loss keys from the internal dict based on selection setting.
Configure optimizer with filtered parameters based on exclusion rules.
Increment the current tick counter.
Train the model using the spectrain(ified batch of data.