scxpand.util.model_type#

Simple model type detection.

This module provides utilities to: 1. Save model type to a separate file during training 2. Load model type from saved file 3. Provide helpful error messages with available options

Functions

get_available_model_types()

Get list of available model types from the ModelType enum.

infer_model_type_from_parameters(results_path)

Infer the model type from saved information.

load_model_type(results_path)

Load model type from saved file.

save_model_type(model_type, save_dir)

Save model type to a text file.

scxpand.util.model_type.get_available_model_types()#

Get list of available model types from the ModelType enum.

Return type:

list[str]

scxpand.util.model_type.infer_model_type_from_parameters(results_path)#

Infer the model type from saved information.

Parameters:

results_path (Path | str) – Path to the directory containing model files

Return type:

str

Returns:

Model type string

Raises:

ValueError – If model type cannot be determined with helpful message

scxpand.util.model_type.load_model_type(results_path)#

Load model type from saved file.

Parameters:

results_path (Path | str) – Path to the directory containing model type file

Return type:

str | None

Returns:

Model type string if found, None if file doesn’t exist

scxpand.util.model_type.save_model_type(model_type, save_dir)#

Save model type to a text file.

Parameters:
  • model_type (str) – The model type string (e.g., “autoencoder”, “mlp”, etc.)

  • save_dir (Path | str) – Directory where to save the model type

Return type:

None