Extending the framework¶
Add a dataset¶
- Add a task block with ordered
labels,classnames, and a canonicalprompt_specto a protocol. - Define metadata columns for slide ID, case/patient ID, and label.
- Register the feature sources the task will use.
- Include the task in the protocol's cohort list.
- Run
scripts/tcga_benchmark.py all --protocol <path>. - Resolve validation errors and inspect feature readiness.
- Run the dummy-feature matrix before launching real-data jobs.
The prompt compiler emits separate method-owned FOCUS and ViLa-MIL headerless
low-then-high CSVs, MUSE description CSVs,
MSCPT description JSON, MAPLE entity JSON, CoD chains, SLIP tissues, an SLDPC
zero-shot synonym bank, and ConVLM attributes from that single canonical
profile. SLDPC Stage 1/2 still needs an explicit ordered prompt_classnames
declaration; generated zero-shot aliases are not a training input.
WSI-FiVE is intentionally not synthesized from this profile. A task must
declare an explicit six-question bank; native mode additionally needs aligned
per-case training answers and a separate class-indexed evaluation bank. If
those upstream assets do not exist, use the explicitly partial
simplified_classnames mode and mark the question bank as generated.
Add a feature source or resolution¶
Register a new source under feature_registry; do not add a new loader solely
because the resolution is new. Set resolution to the intended semantic value
and map that source to an experiment role such as bag, low, or high.
When changing the producer checkpoint, use a new feature_space_id even if
the tensor width is unchanged.
Add an encoder¶
- Create a
BackboneSpecwith exact dimensions, provenance, aliases, and capabilities. - Implement only the narrow wrappers the encoder actually supports.
- Register a builder returning an
EncoderBundle. - Add contract tests for valid and invalid consumers.
- Document whether cached feature extraction must be repeated.
See Backbone interfaces for code examples and SLDPC's paired slide/text requirements.
Add a method¶
- Create
methods/<name>/adapter.pyand subclassBaseMethod. - Declare a
MethodBackboneContract. - Implement
build_model,train_step, andeval_step. - Keep paper-specific implementation files in the method directory.
- Reuse tensor-level loaders from
common.datasetswhere possible. - Register aliases in
methods.get_methodand add the canonical name tomethods.list_methods. - Add the experiment to protocol registries and regenerate configs.
- Add unit tests and run the dummy-feature smoke matrix.
Public classes and functions need Google-style docstrings because the API website is generated directly from source. Use the documentation quality check described in Writing documentation.