DeepMTP.integrations package

Optional integrations remain separate from the core training and HPO implementations. Importing DeepMTP.integrations does not load Streamlit.

Streamlit

Install the optional dependency before constructing a Streamlit adapter:

python -m pip install "DeepMTP[streamlit]"

The canonical Streamlit API is available from one namespace:

from DeepMTP.integrations.streamlit import (
    DeepMTP as StreamlitDeepMTP,
    HyperBand,
    RandomSearch,
    StreamlitHPOProgressObserver,
    StreamlitProgressObserver,
)

Trainer

Core trainer configured with Streamlit progress rendering.

class DeepMTP.integrations.streamlit.trainer.DeepMTP(config: DeepMTPConfig | Mapping[str, Any], instance_branch_model: Callable[[Mapping[str, Any]], torch.nn.Module] | None = None, target_branch_model: Callable[[Mapping[str, Any]], torch.nn.Module] | None = None, checkpoint_dir: str | PathLike[str] | None = None, reporter: ExperimentReporter | None = None, progress: ProgressObserver | None = None)

Bases: DeepMTP

Core DeepMTP trainer configured with Streamlit progress rendering.

DeepMTP.integrations.streamlit.trainer.initialize_mode(config: DeepMTPConfig | Mapping[str, Any]) → DeepMTP

HPO adapters

Hyperparameter optimizers configured with Streamlit progress rendering.

class DeepMTP.integrations.streamlit.hpo.HyperBand(*args: Any, progress: HPOProgressObserver | None = None, **kwargs: Any)

Bases: HyperBand

Core Hyperband configured with Streamlit progress rendering.

class DeepMTP.integrations.streamlit.hpo.RandomSearch(*args: Any, progress: HPOProgressObserver | None = None, **kwargs: Any)

Bases: RandomSearch

Core random search configured with Streamlit progress rendering.

Progress renderers

Streamlit renderers for core DeepMTP progress events.

class DeepMTP.integrations.streamlit.progress.StreamlitAPI(*args, **kwargs)

Bases: Protocol

Small Streamlit surface used by the progress adapters.

empty() → Any

Create an empty UI slot.

progress(value: int) → Any

Create a progress indicator.

class DeepMTP.integrations.streamlit.progress.StreamlitHPOProgressObserver(*, streamlit_module: StreamlitAPI | None = None)

Bases: object

Render shared optimizer events in Streamlit.

on_event(event: HPOProgressEvent) → None
class DeepMTP.integrations.streamlit.progress.StreamlitProgressObserver(config: DeepMTPConfig | Mapping[str, Any] | None = None, *, experiment_dir: str | Path | None = None, streamlit_module: StreamlitAPI | None = None)

Bases: object

Render core training events without owning training logic.

clear() → None

Remove transient progress elements during HPO runs.

configure(config: DeepMTPConfig | Mapping[str, Any], *, experiment_dir: str | Path | None = None) → None

Attach the finalized trainer configuration.

on_event(event: ProgressEvent | EvaluationProgressEvent) → None
on_summary(summaries: RunSummaries, *, include_train: bool, include_validation: bool) → None

Package contents

Streamlit progress renderers and configured runtime adapters.

class DeepMTP.integrations.streamlit.DeepMTP(config: DeepMTPConfig | Mapping[str, Any], instance_branch_model: Callable[[Mapping[str, Any]], torch.nn.Module] | None = None, target_branch_model: Callable[[Mapping[str, Any]], torch.nn.Module] | None = None, checkpoint_dir: str | PathLike[str] | None = None, reporter: ExperimentReporter | None = None, progress: ProgressObserver | None = None)

Bases: DeepMTP

Core DeepMTP trainer configured with Streamlit progress rendering.

class DeepMTP.integrations.streamlit.HyperBand(*args: Any, progress: HPOProgressObserver | None = None, **kwargs: Any)

Bases: HyperBand

Core Hyperband configured with Streamlit progress rendering.

class DeepMTP.integrations.streamlit.RandomSearch(*args: Any, progress: HPOProgressObserver | None = None, **kwargs: Any)

Bases: RandomSearch

Core random search configured with Streamlit progress rendering.

class DeepMTP.integrations.streamlit.StreamlitAPI(*args, **kwargs)

Bases: Protocol

Small Streamlit surface used by the progress adapters.

empty() → Any

Create an empty UI slot.

progress(value: int) → Any

Create a progress indicator.

class DeepMTP.integrations.streamlit.StreamlitHPOProgressObserver(*, streamlit_module: StreamlitAPI | None = None)

Bases: object

Render shared optimizer events in Streamlit.

on_event(event: HPOProgressEvent) → None
class DeepMTP.integrations.streamlit.StreamlitProgressObserver(config: DeepMTPConfig | Mapping[str, Any] | None = None, *, experiment_dir: str | Path | None = None, streamlit_module: StreamlitAPI | None = None)

Bases: object

Render core training events without owning training logic.

clear() → None

Remove transient progress elements during HPO runs.

configure(config: DeepMTPConfig | Mapping[str, Any], *, experiment_dir: str | Path | None = None) → None

Attach the finalized trainer configuration.

on_event(event: ProgressEvent | EvaluationProgressEvent) → None
on_summary(summaries: RunSummaries, *, include_train: bool, include_validation: bool) → None
DeepMTP.integrations.streamlit.initialize_mode(config: DeepMTPConfig | Mapping[str, Any]) → DeepMTP