cann.config package

Submodules

cann.config.model_config module

class cann.config.model_config.FeatureSpec(name, description=None, domain=None)[source]

Bases: object

Describes a single market input feature (e.g. moneyness, time_to_maturity).

Fields:

name, optional description, and optional domain (min, max).

description = None
domain = None
name
class cann.config.model_config.ModelConfig(name, parameters=<factory>, market_inputs=<factory>, outputs=<factory>, train_defaults=None, calibration_defaults=None)[source]

Bases: object

Configuration for a pricing model family.

This object describes the parameter vector theta and the market input feature vector x used by the surrogate.

Key fields include parameters (with bounds), market_inputs (feature layout), outputs, and optional default configs (train_defaults and calibration_defaults).

bounds_array()[source]

Get list of (min, max) bounds for all parameters in order.

calibration_defaults = None
describe()[source]

Print a human-readable description of the model configuration. Which includes descriptions.

classmethod from_dict(cfg)[source]

Create ModelConfig from a plain dictionary.

The dictionary format is expected to match the *.yaml model spec files bundled in the project artifacts.

classmethod from_yaml(path)[source]

Load ModelConfig from a YAML file.

market_inputs
name
property num_market_inputs

Number of market input features.

property num_outputs

Number of model outputs.

property num_parameters

Number of model parameters.

outputs
parameters
train_defaults = None
class cann.config.model_config.OutputSpec(name, description=None, domain=None)[source]

Bases: object

Describes a single model output (e.g., implied_volatility, option_price).

Fields:

name, optional description, and optional domain (min, max).

description = None
domain = None
name
class cann.config.model_config.ParameterSpec(name, min_value, max_value, default=None, scale='linear', description=None)[source]

Bases: object

Specification for a single model parameter (e.g., rho, kappa).

Fields:

name, min_value, max_value, optional default, optional description, and scale (“linear” or “log”).

default = None
description = None
max_value
min_value
name
scale = 'linear'
validate_value(value)[source]

Validate that the given value is within the specified bounds.

Parameters:

value (float) – The value to validate.

Raises:

ValueError – If the value is out of bounds [min_value, max_value].

Module contents