dacapo.gp.dacapo_create_target
Module Contents
Classes
A Gunpowder node for generating the target from the ground truth |
- class dacapo.gp.dacapo_create_target.DaCapoTargetFilter(predictor: dacapo.experiments.tasks.predictors.Predictor, gt_key: gunpowder.ArrayKey, target_key: gunpowder.ArrayKey | None = None, weights_key: gunpowder.ArrayKey | None = None, mask_key: gunpowder.ArrayKey | None = None)
A Gunpowder node for generating the target from the ground truth
- Parameters:
Predictor (Predictor) – The DaCapo Predictor to use to transform gt into target
gt (
Array) – The dataset to use for generating the target.target_key (
gp.ArrayKey) – The key with which to provide the target.
- setup()
To be implemented in subclasses.
Called during initialization of the DAG. Callees can assume that all upstream providers are set up already.
In setup, call
provides()orupdates()to announce the arrays and points provided or changed by this node.
- prepare(request)
To be implemented in subclasses.
Prepare for a batch request. Should return a
BatchRequestof needed dependencies. If None is returned, it will be assumed that all of request is needed.
- process(batch, request)
To be implemented in subclasses.
Filter a batch, will be called after
prepare(). Should return aBatchcontaining modified Arrays and Graphs. Keys in the returned batch will replace the associated data in the original batch. If None is returned it is assumed that the batch has been modified in place.requestis the same as passed toprepare(), provided for convenience.- Parameters:
batch (
Batch) – The batch received from upstream to be modified by this node.request (
BatchRequest) – The request this node received. The updated batch should meet this request.