Skip to main content

gam_model_api/
lib.rs

1//! The `CustomFamily` trait itself plus the evaluation result structs it returns
2//! (`FamilyEvaluation`, joint-gradient/batched-term carriers) and the eval-scope /
3//! outer-eval-context enums that parameterize trait calls.
4
5pub mod families {
6    pub mod custom_family {
7        pub mod family_trait;
8        pub mod joint_newton_defaults;
9        pub mod options;
10        pub mod psi_design;
11
12        pub use family_trait::*;
13        pub use options::*;
14        pub use psi_design::*;
15    }
16}
17
18// `joint_penalty` and `outer_subsample` are neutral low-layer primitives that
19// live in `gam-problem` (below the `CustomFamily` trait). Re-export the modules
20// and their public types so existing `gam_model_api::{joint_penalty,
21// outer_subsample}::*` and `crate::{OuterScoreSubsample, JointPenaltyBundle, …}`
22// paths stay stable without duplicating the sources.
23pub use gam_problem::{joint_penalty, outer_subsample};
24
25pub use families::custom_family::*;
26pub use gam_problem::joint_penalty::{JointPenaltyBundle, JointPenaltyError, JointPenaltySpec};
27pub use gam_problem::outer_subsample::{OuterScoreSubsample, RowSet, WeightedOuterRow};
28
29#[derive(Clone, Copy, Debug, PartialEq, Eq)]
30pub enum OuterEvalOrder {
31    /// Compute only the objective value.
32    Value,
33    /// Compute value and gradient only.
34    ValueAndGradient,
35    /// Compute value, gradient, and analytic Hessian when available.
36    ValueGradientHessian,
37}