Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Smoother

sindae.algorithms.smoother

The smoother NLP fits a smooth trajectory to noisy observations and produces the warm-start values and normalization statistics used by subsequent training. It penalises the time derivative of the NN-output variable zsmoothz_\text{smooth}, weighted by smooth_coef (larger ⇒ smoother fit).

Running the smoother is the first step of the standard workflow: the solved model both warm-starts the main solve (it is already built and discretized) and supplies the normalization constants for the network.

Usage

from sindae import extract_instance_data
from sindae.algorithms.smoother import solve_smoother

# problem.obs_times / problem.obs_values must be set (from data or generate_data)
smoother_m    = solve_smoother(problem, mlp, smooth_coef=1.0)
smoother_data = extract_instance_data(problem, smoother_m)

# smoother_data feeds pre-training and supplies normalization stats;
# smoother_m can be reused as the base model for the training solve.

API reference

SmootherConfig

class SmootherConfig(smooth_coef: float = 1.0)

Hyperparameters for the smoother stage (used by HybridDAE).

smooth_coef weights the smoothness penalty smooth_coef * mean((dz_smooth/dt)^2) against the data fit; larger values give smoother warm-start trajectories.

Fields

build_smoother_model

build_smoother_model(
    problem: ProblemDefinition,
    mlp: SimpleMLP,
    traj_indices: List[int],
    smooth_coef: float = 1.0,
    unfix_io: bool = True,
) -> pyo.ConcreteModel

Build a multi-trajectory smoother NLP.

A raw auxiliary variable z_smooth[t, k] is linked to get_output_vars and its time derivative is penalised for smoothness. No norm_input or norm_output vars are created here; those are added post-discretisation when the decomp or simultaneous model is built from the solved smoother.

Obs stats are computed from problem.obs_values so this can be called before problem.norm_stats is set.

Parameters

Returns

solve_smoother

solve_smoother(
    problem: ProblemDefinition,
    mlp: SimpleMLP,
    traj_indices: Optional[List[int]] = None,
    smooth_coef: float = 1.0,
    solver_options: Optional[dict] = None,
    nlp_solver: str = 'pounce',
    timer: Optional[HierarchicalTimer] = None,
    unfix_io: bool = True,
) -> pyo.ConcreteModel

Build and solve the smoother NLP, returning the solved model.

Parameters

Returns