Skip to content

Power fitting objective models

Deprecated compatibility route

This v0.7 historical module will be removed in v0.8. Import objective models from pyvoro2.inverse.separator instead.

pyvoro2.powerfit.model

Compatibility exports for separator objective models.

ExponentialBoundaryPenalty dataclass

Bases: ScalarPenalty

Repulsive penalty near the boundaries of an interval.

The penalty is based on exponentials measured from an inner interval [lower + margin, upper - margin].

FitModel dataclass

Complete objective definition for inverse power-weight fitting.

The objective consists of
  • one required mismatch term,
  • an optional hard feasibility set,
  • zero or more extra penalties,
  • optional L2 regularization on the weights.

FixedValue dataclass

Bases: HardConstraint

Hard equality restriction in the chosen measurement space.

HardConstraint

Base class for hard feasibility restrictions.

HuberLoss dataclass

Bases: ScalarMismatch

Huber mismatch penalty in the chosen measurement space.

The penalty is quadratic near zero and linear for large residuals.

Interval dataclass

Bases: HardConstraint

Hard interval restriction in the chosen measurement space.

L2Regularization dataclass

Optional L2 regularization on the weight vector.

ReciprocalBoundaryPenalty dataclass

Bases: ScalarPenalty

Reciprocal repulsion near interval boundaries.

This penalty is intended to be used together with a hard interval or a strong outside penalty. It penalizes separator positions that enter the boundary layers [lower, lower + margin] and [upper - margin, upper].

ScalarMismatch

Base class for mismatch terms applied to predicted separator positions.

ScalarPenalty

Base class for additional scalar penalties.

SoftIntervalPenalty dataclass

Bases: ScalarPenalty

Quadratic penalty for leaving a preferred interval.

The penalty is zero within [lower, upper] and quadratic outside.

SquaredLoss dataclass

Bases: ScalarMismatch

Quadratic mismatch penalty: (predicted - target)^2.

:::