Execution of composed models #
Sequential composition preserves the order of model state, forward calls, and buffer updates. These equations keep the execution monad and scalar backend abstract. They therefore apply to graph recording as well as eager execution, without expanding either backend's operation instance.
Composed models retain the state of the first model followed by the second model's state.
Applying a model's curried program passes its state and input to the sequential evaluator.
A single-layer model in evaluation mode runs that layer without a buffer-update callback.
Composed model execution is monadic composition, with the original state and effect order.
In training mode this includes buffer-update callbacks after each layer. The proof uses only monad laws; it neither commutes effects nor assumes algebraic laws on numerical operations.