BaseEstimator¶
The abstract base class defining the estimator interface.
Overview¶
All estimators in Falcon must implement this interface. The base class defines methods for:
- Training (
train) - Sampling (
sample_prior,sample_posterior,sample_proposal) - Persistence (
save,load) - Control flow (
pause,resume,interrupt)
Class Reference¶
BaseEstimator
¶
Bases: ABC
Fully abstract base class defining the estimator interface.
All methods are abstract - no implementation details. Concrete implementations must provide all functionality.
train
abstractmethod
async
¶
Train the estimator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
buffer
|
BufferView providing access to training/validation data |
required |
sample_prior
abstractmethod
¶
Sample from the prior distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_samples
|
int
|
Number of samples to generate |
required |
parent_conditions
|
List
|
Conditioning values from parent nodes |
[]
|
Returns:
| Type | Description |
|---|---|
RVBatch
|
RVBatch with samples and log probabilities |
Source code in falcon/core/base_estimator.py
sample_posterior
abstractmethod
¶
Sample from the posterior distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_samples
|
int
|
Number of samples to generate |
required |
parent_conditions
|
List
|
Conditioning values from parent nodes |
[]
|
evidence_conditions
|
List
|
Observed evidence values |
[]
|
Returns:
| Type | Description |
|---|---|
RVBatch
|
RVBatch with samples and log probabilities |
Source code in falcon/core/base_estimator.py
sample_proposal
abstractmethod
¶
Sample from the proposal distribution for adaptive resampling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_samples
|
int
|
Number of samples to generate |
required |
parent_conditions
|
List
|
Conditioning values from parent nodes |
[]
|
evidence_conditions
|
List
|
Observed evidence values |
[]
|
Returns:
| Type | Description |
|---|---|
RVBatch
|
RVBatch with samples and log probabilities |
Source code in falcon/core/base_estimator.py
save
abstractmethod
¶
Save estimator state to directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_dir
|
Path
|
Directory to save state to |
required |
load
abstractmethod
¶
Load estimator state from directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_dir
|
Path
|
Directory to load state from |
required |