Skip to content

module adabmDCA.api.input_loading

Aggregate input loading for high-level workflows.


function load_training_inputs

load_training_inputs(
    training: 'AlignmentInput',
    config: 'TrainingConfig',
    device: 'device',
    dtype: 'dtype',
    validation: 'AlignmentInput | None' = None,
    weights: 'WeightInput | None' = None,
    initial_params_path: 'str | Path | None' = None,
    initial_chains_path: 'str | Path | None' = None,
    allow_signed_weights: 'bool' = False
) → TrainingInputs

Load the training inputs of train_model and check they fit together.

Sequences with unknown tokens are dropped and duplicates removed. The validation alignment, initial parameters and initial chains must have the training alignment's length and alphabet.

Args:

  • training: Training alignment (path, Alignment or sequences).
  • config: Training settings; provides alphabet and reweighting options.
  • device: Device of the loaded tensors.
  • dtype: Precision of the loaded tensors.
  • validation: Optional validation alignment.
  • weights: Optional training-sequence weights (path, array or tensor).
  • initial_params_path: Optional parameter file to start from.
  • initial_chains_path: Optional FASTA of starting chains.
  • allow_signed_weights: Accept negative weights (experimental reintegration).

Returns: The loaded TrainingInputs.

Raises:

  • ModelCompatibilityError: If validation data, parameters or chains do not match the training alignment.
  • InputLoadError: If a file cannot be read.

class TrainingInputs

Loaded and cross-checked inputs of one training run.

Attributes:

  • training: Weighted training dataset.
  • training_alignment: Training alignment after filtering.
  • validation: Weighted validation dataset, if any.
  • validation_alignment: Validation alignment after filtering, if any.
  • initial_params: Parameters to start from, if given.
  • initial_chains: One-hot chains to start from, if given.

method __init__

__init__(
    training: 'DatasetDCA',
    training_alignment: 'Alignment',
    validation: 'DatasetDCA | None' = None,
    validation_alignment: 'Alignment | None' = None,
    initial_params: 'dict[str, Tensor] | None' = None,
    initial_chains: 'Tensor | None' = None
) → None

This file was automatically generated via lazydocs.