pub struct Config {Show 13 fields
pub population: usize,
pub max_depth: usize,
pub max_epochs: usize,
pub learning_rate: f64,
pub lambda_complexity: f64,
pub lambda_sparsity: f64,
pub lambda_parsimony: f64,
pub tau_start: f64,
pub tau_end: f64,
pub temp_schedule: TempSchedule,
pub seed: u64,
pub top_k: usize,
pub backend: Backend,
}Expand description
Configuration for a crate::Discoverer run.
Construct with Config::default and adjust via the builder methods, e.g.
use phop_core::Config;
let cfg = Config::default().population(256).max_depth(10).max_epochs(2_000);
assert_eq!(cfg.population, 256);Fields§
§population: usizeNumber of candidate trees evaluated jointly.
max_depth: usizeMaximum depth of candidate EML trees.
max_epochs: usizeMaximum number of optimization epochs.
learning_rate: f64Adam learning rate.
lambda_complexity: f64Weight on the complexity penalty in the multi-objective loss.
lambda_sparsity: f64Weight on the sparsity penalty (pressure toward the constant 1).
lambda_parsimony: f64Weight on the parsimony (depth) penalty.
tau_start: f64Initial Gumbel-Softmax temperature.
tau_end: f64Final Gumbel-Softmax temperature.
temp_schedule: TempScheduleTemperature annealing schedule.
seed: u64RNG seed for reproducibility.
top_k: usizeNumber of solutions to keep on the Pareto front.
backend: BackendCompute backend for constant fitting (CPU by default; CUDA when built and available).
Implementations§
Source§impl Config
impl Config
Sourcepub fn population(self, p: usize) -> Self
pub fn population(self, p: usize) -> Self
Set the population size.
Sourcepub fn max_epochs(self, n: usize) -> Self
pub fn max_epochs(self, n: usize) -> Self
Set the maximum number of epochs.
Sourcepub fn learning_rate(self, lr: f64) -> Self
pub fn learning_rate(self, lr: f64) -> Self
Set the Adam learning rate.
Sourcepub fn temperature(&self, t: f64) -> f64
pub fn temperature(&self, t: f64) -> f64
Temperature at training progress t in [0, 1] under the configured schedule.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.