Skip to main content

ModelFactory

Trait ModelFactory 

Source
pub trait ModelFactory: Send + Sync {
    // Required methods
    fn config_space(&self) -> ConfigSpace;
    fn create(&self, config: &HyperConfig) -> Box<dyn StreamingLearner>;
    fn name(&self) -> &str;

    // Provided methods
    fn warmup_hint(&self) -> usize { ... }
    fn complexity_hint(&self) -> usize { ... }
}
Expand description

Factory for creating streaming learner instances from hyperparameter configurations.

Implementations define the hyperparameter search space and how to construct a model from a given configuration point.

Required Methods§

Source

fn config_space(&self) -> ConfigSpace

The hyperparameter search space for this model type.

Source

fn create(&self, config: &HyperConfig) -> Box<dyn StreamingLearner>

Create a new model instance from a hyperparameter configuration.

The config values correspond to the parameters in config_space().

Source

fn name(&self) -> &str

Human-readable name for this model type (e.g., “SGBT”, “ESN”).

Provided Methods§

Source

fn warmup_hint(&self) -> usize

Minimum samples a new model needs before its metrics are meaningful.

Candidates that have seen fewer than warmup_hint() samples are protected from elimination during tournament rounds. This prevents neural architectures with warmup phases (ESN, Mamba, SpikeNet) from being prematurely killed by models that start predicting immediately.

The default is 0 (no warmup protection).

Source

fn complexity_hint(&self) -> usize

Approximate model complexity (effective parameter count).

Used for complexity-adjusted elimination: models with higher complexity are penalized more when evaluation data is scarce. This naturally favors simpler models on sparse data and lets complex models prove themselves when data is abundant.

The default is 100 (moderate complexity).

Implementors§