quantdata.dysanos.grid.gendysanos.case_c#
Case C models and analytic gradients for conditional-arbitrage tracing.
Case C keeps the power-exponential utility parameter fixed at one and scales
the economic P&L by an externally supplied notional n. Long and short
notionals are separate nonnegative variables. Optimization uses the true
utility gradient divided by expected marginal utility, which preserves every
stationary point while removing the common exponentially small scale.
- class quantdata.dysanos.grid.gendysanos.case_c.CaseCAction(env, *, config, state_mean, state_whitener)[source]#
Bases:
BaseModelA deterministic
t0action and a conditionalt6action network.- raw_action(conditional_state)[source]#
Return raw long/short variables for deterministic and conditional times.
- class quantdata.dysanos.grid.gendysanos.case_c.CaseCConfig(*, label, source_cache_uid, state_features, notionals, deterministic_time=0, conditional_time=6, expiries=7, instruments_per_expiry=21, group='', user_version='0.1', network_config=FeedForwardConfig(activation='SiLU', num_depth=2, num_width=96, use_bias=True))[source]#
Bases:
objectLogical configuration of a deterministic/conditional Case C pair.
- network_config: FeedForwardConfig = FeedForwardConfig(activation='SiLU', num_depth=2, num_width=96, use_bias=True)#
- class quantdata.dysanos.grid.gendysanos.case_c.CaseCTrainConfig(*, batch_size=4096, valuation_batch_size=16384, epochs_per_notional=20000, minimum_epochs_per_notional=2000, value_update=250, checkpoint_update=2000, convergence_points=8, action_change_tolerance=2e-05, lr=0.0003, compile=True, seed=182071)[source]#
Bases:
objectOperational settings for the notional continuation.
- quantdata.dysanos.grid.gendysanos.case_c.case_c_numerical_band(action, returns, costs, instrument_band)[source]#
Propagate observation-specific float32 errors through one portfolio.
- quantdata.dysanos.grid.gendysanos.case_c.case_c_objective_and_surrogate(pnl, path_weight, *, notional)[source]#
Return economic utility and its normalized analytic-gradient surrogate.
The surrogate has no economic interpretation as a level. Its derivative is exactly the true power-exp derivative divided by expected marginal utility, with the irrelevant positive notional factor omitted.
- quantdata.dysanos.grid.gendysanos.case_c.case_c_pnl(action, returns, costs)[source]#
Return per-unit net P&L for separate long and short notionals.
- quantdata.dysanos.grid.gendysanos.case_c.normalized_marginal_weights(pnl, path_weight, *, notional)[source]#
Return normalized physical marginal-utility weights in log space.
- quantdata.dysanos.grid.gendysanos.case_c.powerexp_one(scaled_pnl)[source]#
Return fixed-lambda-one power-exp utility and marginal utility.
- quantdata.dysanos.grid.gendysanos.case_c.projected_long_short(raw)[source]#
Return nonnegative long/short actions with total gross norm at most one.
The forward value is the radial projection of the positive part. At zero, a straight-through positive-part derivative keeps both long and short directions learnable. Outside the ball, the exact radial-projection derivative removes only the infeasible radial direction and preserves all tangential direction-changing gradients. No exterior penalty is used.
- quantdata.dysanos.grid.gendysanos.case_c.simplex_long_short(logits, *, expiries, instruments_per_expiry)[source]#
Map portfolio logits and one no-trade logit to the unit gross simplex.
This is the mirror-descent geometry natural for separate nonnegative long and short notionals. The final coordinate is uninvested gross capacity, so an interior optimum is represented without clipping or a penalty.