quantdata.dysanos.grid.gendysanos.norm_continuation#

Fixed-radius continuation models for conditional-arbitrage searches.

For every trading time, one network jointly trades all matched expiries and instruments. Its unconstrained output v_t(x_t) is projected radially onto an L1 ball of radius n. The utility sees only the feasible action, while an exterior quadratic penalty supplies a radial recovery gradient whenever the unconstrained output leaves the ball.

class quantdata.dysanos.grid.gendysanos.norm_continuation.NormContinuationAction(env, *, config, state_mean, state_whitener)[source]#

Bases: BaseModel

Independent per-time action networks in physical orthogonal factors.

zero_output_layers()[source]#

Start from no trade while retaining the local output derivative.

raw_action(state)[source]#

Return the unconstrained action in whitened state coordinates.

forward(state, radius)[source]#

Return the feasible action, raw L1 norm, and clipping indicator.

class quantdata.dysanos.grid.gendysanos.norm_continuation.NormContinuationConfig(*, label, source_cache_uid, state_features, risk_aversion, utility, radii, exterior_penalty, trading_times=10, expiries=7, instruments_per_expiry=21, covariance_relative_floor=1e-10, group='', user_version='0.1', network_config=FeedForwardConfig(activation='SiLU', num_depth=2, num_width=96, use_bias=True))[source]#

Bases: object

Logical geometry and objective of one radius-continuation search.

trading_times: int = 10#
expiries: int = 7#
instruments_per_expiry: int = 21#
covariance_relative_floor: float = 1e-10#
group: str = ''#
user_version: str = '0.1'#
network_config: FeedForwardConfig = FeedForwardConfig(activation='SiLU', num_depth=2, num_width=96, use_bias=True)#
property filename: str#
class quantdata.dysanos.grid.gendysanos.norm_continuation.NormContinuationTrainConfig(*, batch_size=4096, valuation_batch_size=16384, epochs_per_radius=10000, minimum_epochs_per_radius=1500, value_update=250, checkpoint_update=2000, lr=0.0003, weight_decay=0.0, compile=True, convergence_points=10, convergence_relative_tolerance=0.0001, seed=94103)[source]#

Bases: object

Operational settings shared by all continuation radii.

batch_size: int = 4096#
valuation_batch_size: int = 16384#
epochs_per_radius: int = 10000#
minimum_epochs_per_radius: int = 1500#
value_update: int = 250#
checkpoint_update: int = 2000#
lr: float = 0.0003#
weight_decay: float = 0.0#
compile: bool = True#
convergence_points: int = 10#
convergence_relative_tolerance: float = 0.0001#
seed: int = 94103#
quantdata.dysanos.grid.gendysanos.norm_continuation.clipped_radius_pnl_derivative(pnl, clipped, radius)[source]#

Differentiate feasible P&L with respect to a frozen L1 radius.

Transaction costs are homogeneous in the action. Thus a clipped action and its P&L scale linearly with the radius, while an interior action is locally independent of the radius.

quantdata.dysanos.grid.gendysanos.norm_continuation.continuation_loss(model, state, returns, costs, path_weight, *, radius)[source]#

Return the penalized loss and its unpenalized components by time.

quantdata.dysanos.grid.gendysanos.norm_continuation.continuation_pnl(action, returns, costs)[source]#

Return exact net P&L for each path and trading time.

quantdata.dysanos.grid.gendysanos.norm_continuation.exterior_l1_penalty(raw_l1, radius)[source]#

Return \(E[(\|v_t\|_1-n)_+^2]\) separately by trading time.

quantdata.dysanos.grid.gendysanos.norm_continuation.radial_l1_clip(raw, radius)[source]#

Project each path/time action radially onto its L1 ball.

The final two axes are the expiry and within-expiry instrument axes. The returned Boolean tensor identifies outputs in the exterior region where the radial utility derivative is zero but tangential derivatives remain.