You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #43. Depends on #45 (sample contract) and #47 (package scaffolder).
When the user has no model code (tier 4 of the evidence hierarchy, pure elicitation), the builder has nothing to verify the consumer contract against, and the user receives a Dataset with no demonstration that it feeds anything. Both problems are solved by generating a minimal reference model alongside the training loop, so the deliverable is a working example rather than an untested class.
The reference model is a contract witness, not an architecture recommendation. Its purpose is to prove tensors flow, to make the model-forward check runnable in every case, and to give the user a working starting point to replace. It must be labeled that way in the generated code and the README, or a domain scientist will reasonably read it as DSAgt endorsing an architecture for their science.
Scope
Emit examples/train_minimal.py in every case. When the user has model code, it imports their model; otherwise it imports the generated reference model.
Emit examples/model.py only when the user has no model code. Smallest architecture that consumes the declared contract, chosen from the contract's shapes and semantic roles.
Sample kinds covered in v1: array, tabular, and graph. Array and tabular samples get an MLP head over flattened inputs. Graph samples get a two-layer message-passing network.
The graph reference model is implemented in plain torch using Tensor.index_add_ for neighborhood aggregation, nottorch_geometric. PyG is a heavy dependency with compiled extensions version-matched to the torch build, and a reference model that fails to import defeats its own purpose: the acceptance criterion is that the example runs on CPU in under a minute, which it cannot do if the user first has to solve a PyG installation.
The exception is a contract that already commits to PyG (as the XGC case does, where samples are torch_geometric.data.Data objects). There the collation is PyG's, so the reference model uses PyG too and the dependency is already the user's, not one the builder introduced.
The training loop runs a handful of steps over a small subset, prints the loss, and exits. It is a smoke harness, not a training script: no checkpoints, no schedulers, no logging integrations.
Both files carry a header comment stating the model is a placeholder for contract verification.
Acceptance criteria
python examples/train_minimal.py completes on CPU in under a minute against the project's data and shows a loss value.
Part of #43. Depends on #45 (sample contract) and #47 (package scaffolder).
When the user has no model code (tier 4 of the evidence hierarchy, pure elicitation), the builder has nothing to verify the consumer contract against, and the user receives a
Datasetwith no demonstration that it feeds anything. Both problems are solved by generating a minimal reference model alongside the training loop, so the deliverable is a working example rather than an untested class.The reference model is a contract witness, not an architecture recommendation. Its purpose is to prove tensors flow, to make the model-forward check runnable in every case, and to give the user a working starting point to replace. It must be labeled that way in the generated code and the README, or a domain scientist will reasonably read it as DSAgt endorsing an architecture for their science.
Scope
examples/train_minimal.pyin every case. When the user has model code, it imports their model; otherwise it imports the generated reference model.examples/model.pyonly when the user has no model code. Smallest architecture that consumes the declared contract, chosen from the contract's shapes and semantic roles.torchusingTensor.index_add_for neighborhood aggregation, nottorch_geometric. PyG is a heavy dependency with compiled extensions version-matched to the torch build, and a reference model that fails to import defeats its own purpose: the acceptance criterion is that the example runs on CPU in under a minute, which it cannot do if the user first has to solve a PyG installation.torch_geometric.data.Dataobjects). There the collation is PyG's, so the reference model uses PyG too and the dependency is already the user's, not one the builder introduced.Acceptance criteria
python examples/train_minimal.pycompletes on CPU in under a minute against the project's data and shows a loss value.check-datasetcode #46 passes using the generated model when no user model exists.