1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Crate-private objective contract shared by FerricML's solvers.
//!
//! An estimator used to fuse three separate decisions into one body of code:
//! *what* is being minimized, *how* a raw score becomes the quantity the target
//! is compared with, and *which* update rule walks downhill. This module owns
//! the first two. A solver names an [`Objective`] as a generic parameter and
//! reads its declared properties, so adding a loss no longer costs one
//! estimator-sized change per estimator.
//!
//! # Boundaries
//!
//! - The contract is private. Losses are not public vocabulary, and keeping
//! them internal lets their representation change without API churn.
//! - Dispatch is entirely at compile time. Nothing here is object-safe by
//! accident and nothing takes `&self`, so no hot path can acquire a per-row
//! virtual call by mistake.
//! - This module depends on [`crate::numeric`] and on nothing else in the
//! crate. An objective that named a concrete estimator would invert the
//! dependency the contract exists to create;
//! `scripts/check_source_layout.py` enforces that mechanically.
//! - Reductions over rows stay with the caller. Fitted artifacts depend on
//! accumulation order, and only the solver knows the order its determinism
//! guarantee is written against.
//! - The non-generic helpers a solver calls once per row or per candidate split
//! are marked `#[inline]`. That is not tuning: each one replaces arithmetic
//! that used to sit inside the solver's own loop body, and the attribute
//! restores the inlining opportunity the move across a module boundary would
//! otherwise have removed. The generic entry points need no attribute,
//! being instantiated in the caller's own codegen unit.
pub use BinaryLogLoss;
pub use ;
pub use ;
pub use Objective;
pub use ElasticNetPenalty;
pub use SquaredError;