mod py_objective¶
- module py_objective¶
Adapter wrapping a Python callable into the Rust Objective<f64> trait. Adapter wrapping a Python callable into the Rust Objective<f64> trait.
The numpy 0.26 crate is built against ndarray 0.16, while the rest of eindir-core uses ndarray 0.17. To avoid an ABI mismatch between the two ndarray copies, we cross the pyo3 boundary as
&[f64]/ Vec<f64> and reconstruct ndarray 0.17 Array1<f64>` /ArrayView1<f64>` on the Rust side via ``Array1::from_vec/ArrayView1::from.Functions
- fn low_discrepancy_points(low: PyReadonlyArray1<'_, f64>, high: PyReadonlyArray1<'_, f64>, n: usize, skip: u64) -> PyResult<Vec<Vec<f64>>>¶
Low-discrepancy points scaled to the supplied box bounds.
- fn shifted_low_discrepancy_points(low: PyReadonlyArray1<'_, f64>, high: PyReadonlyArray1<'_, f64>, n: usize, skip: u64, seed: u64) -> PyResult<Vec<Vec<f64>>>¶
Deterministically shifted low-discrepancy points scaled to box bounds.
Structs and Unions
- struct PyBounds¶
pyo3-exposed wrapper around Bounds<f64> constructed from numpy arrays.
Implementations
- struct PyObjective¶
Wraps a Python callable into the Rust Objective<f64> trait so the SA driver loop can call user-defined Python objectives without leaving Rust per evaluation.
When
grad_fnis supplied at construction the object also implements Gradient<f64> (native / analytic gradient, Ceres-style). Without a supplied gradient, callers useFiniteDiffGradientexplicitly.Implementations
- impl PyObjective¶