v6.4.31
Wed Sep 23 2026
Bug Fixes
AI-Engine
- let the target skip the pre and post period The optimize endpoint summed the target over every date in the data window, even when only a
dates_subsetwas optimized. For a goal target the dates before the subset are a fixed amount the optimized media cannot move, so an absolute goal meant for the optimized weeks sat far below that floor and the optimizer cut all spend to zero (danske-spil optimization 47: 37.6M goal against a 136.7M four-week total). Targets now takeinclude_pre_periodandinclude_post_period. The same slice drives the loss, its normalisation and the reported baseline/result. Goal targets leave the pre-period out by default; dynamic targets keep both, so their results do not change. - make the directions a tie-breaker in the goal loss The goal loss was
(1 + |target - goal|) * direction_loss. A product trades relative changes, so halving the direction term (all spend to its minimum) beat closing the gap whenever the goal was out of reach by more than the whole media effect: with Minimize directions an unreachable goal ended at zero spend. The loss is now the relative miss plusDIRECTION_WEIGHT(1%) times the direction position. The goal wins while it is out of reach, and the directions only choose between plans that meet it equally well. Replaying danske-spil optimization 47 with a 50M goal the model cannot reach now spends 3.35M of the 3.36M budget instead of nothing; the reachable 37.6M goal still lands at 37.55M.
Unknown commit type
AI-Engine
- pin down how the goal loss trades the goal against directions Three layers, each checked to fail against the old product loss: - goal_loss properties: symmetric and growing in the miss, independent of the target's unit, gradients of 1/norm and DIRECTION_WEIGHT, and a miss of DIRECTION_WEIGHT outweighing the whole direction span. - A linear toy model optimized with Adam at unit and 1e6 scale: an unreachable goal maxes every effective channel under Minimize, a goal below the floor mins them under Maximize, a reachable goal is met and leans to less or more spend per the directions, and a channel without effect follows its direction. The loss also ranks the plans that meet the goal by their directions. - api.optimize on the trained fixture model, against the range it can reach: unreachable, below-floor, reachable at 25/50/75% for every direction, a relative goal, and a goal over a dates_subset with and without the pre-period.