quantdata.dysanos.grid.torch_pricer#
SANOS (Torch)#
Fitting the DLVs of SANOS.
- class quantdata.dysanos.grid.torch_pricer.SanosDecoderConfig(smoothness=None, num_state=20, num_nms=20, learn_nms=False, nms_range=(-2, 1), nms_eps=None, min_dlv=0.009, max_dlv=3.0, min_fvol=0.01, max_fvol=2.0, nn_config=FeedForwardConfig(activation='Softplus', num_depth=0, num_width=16, use_bias=True), _xnms_scale=2.0)[source]#
Bases:
object- nn_config: FeedForwardConfig = FeedForwardConfig(activation='Softplus', num_depth=0, num_width=16, use_bias=True)#
- property minmax_str#
- class quantdata.dysanos.grid.torch_pricer.SanosPricer(*, smoothness, expiries, xstrikes, xdensities, xdensity0, sqrtVars, dlvsqs=None, xnms=None, debug=False)[source]#
Bases:
object- verify(condition, message)[source]#
verify
conditionand raise an error withmessageif not satisfied; ifself.debugis False, this function does nothing.
- property strikes: Tensor#
Return the strikes (S, T, N) this model was trained
- static create(smoothness, model_output, *, debug=False)[source]#
Create a
SanosPricerfrom the output of aSanosDecoder
- __call__(market_strikes, *, dt=None, training=False)[source]#
Price call prices for the provided market strikes
- asdict()[source]#
Return a dictionary representation of the
SanosPricer
- class quantdata.dysanos.grid.torch_pricer.SanosDecoder(env, num_expiries, *, config)[source]#
Bases:
BaseModelSANOS functional which decodes a
stateofnum_stateelements into SANOS parameters, returned as aSanosPricerobject.The decoder is a feedforward neural network with
num_stateinputs andnum_outputoutputs, wherenum_outputis determined by the number of expiries and the number of moneyness levels.