Skip to main content

optirs_core/privacy/private_hyperparameter_optimization/
mod.rs

1//! Differentially private hyperparameter optimization.
2//!
3//! # Module layout
4//!
5//! | module | responsibility |
6//! |---|---|
7//! | [`types`] | configuration and the search-component data types |
8//! | [`budget_manager`] | privacy budget allocation and accounting |
9//! | [`optimizer`] | the `PrivateHyperparameterOptimizer` driver |
10//! | [`results`] | private aggregation and the selection report |
11//! | [`selection`] | the private selection mechanisms and noisy statistics |
12//! | [`gaussian_process`] | the GP surrogate and acquisition function |
13//! | [`random_search`] | `NoisyOptimizer` for random search |
14//! | [`bayesian_optimization`] | `NoisyOptimizer` for Bayesian optimization |
15//! | [`functions`] | the `NoisyOptimizer` trait and function aliases |
16//! | [`trait_impls`] | the `Default` impls |
17//!
18//! # 0.3.2 notes
19//!
20//! Hyperparameter *selection* is now differentially private. Previously
21//! `HyperparameterNoiseMechanism` was stored and never matched on: the choice
22//! was the exact argmax over utilities computed from the private data, which is
23//! precisely what private HPO exists to avoid.
24//!
25//! Behavioural and API changes:
26//!
27//! * [`optimizer::PrivateHyperparameterOptimizer::new`] rejects a configuration with
28//!   `private_model_selection: true` that declares no objective sensitivity.
29//! * [`types::PrivateHPOResults`] gained `selection`, which records whether the
30//!   returned configuration was chosen privately, by which mechanism, and at
31//!   what cost.
32//! * [`types::SelectionParameters`] gained `delta` (needed to calibrate Gaussian
33//!   selection).
34//! * `PrivateResultsAggregator::aggregate_results` takes `&mut self`, because
35//!   selecting now spends budget.
36//! * The 16 `*_traits.rs` shells were collapsed into [`trait_impls`]; the two
37//!   that held real `NoisyOptimizer` implementations were renamed to
38//!   [`random_search`] and [`bayesian_optimization`].
39
40pub mod bayesian_optimization;
41pub mod budget_manager;
42pub mod functions;
43pub mod gaussian_process;
44pub mod optimizer;
45pub mod random_search;
46pub mod results;
47pub mod selection;
48pub mod trait_impls;
49pub mod types;
50
51pub use budget_manager::{
52    AdaptiveBudgetController, HPOBudgetManager, DEFAULT_SELECTION_BUDGET_FRACTION,
53};
54pub use functions::*;
55pub use gaussian_process::{
56    encode_configuration, ConfigurationEncoding, ExpectedImprovement, GaussianProcessFit,
57};
58pub use optimizer::PrivateHyperparameterOptimizer;
59pub use results::{PrivateResultsAggregator, SelectionReport, PRIVATE_TOP_K};
60pub use selection::{
61    exponential_mechanism_index, exponential_mechanism_probabilities, gaussian_sigma,
62    laplace_sample, mechanism_name, noisy_summary_statistics, report_noisy_max_gaussian,
63    report_noisy_max_gumbel, report_noisy_max_laplace, summary_mean_noise_scale, NoisySummary,
64    SelectionOutcome, OBJECTIVE_SENSITIVITY_KEY, SUMMARY_QUANTILES,
65};
66pub use types::*;