RBTransiNetInterface¶
- class lsst.meas.transiNet.RBTransiNetInterface(model_package_name, package_storage_mode, device='cpu')¶
Bases:
object
The interface between the LSST AP pipeline and a trained pytorch-based RBTransiNet neural network model.
- Parameters:
Methods Summary
infer
(inputs)Return the score of this cutout.
Create and initialize an NN model
input_to_batches
(inputs, batchSize)Convert a list of inputs to a generator of batches.
prepare_input
(inputs)Convert inputs from numpy arrays, etc.
Methods Documentation
- infer(inputs)¶
Return the score of this cutout.
- Parameters:
- inputs
list
[CutoutInputs
] Inputs to be scored.
- inputs
- Returns:
- scores
numpy.array
Float scores for each element of
inputs
.
- scores
- init_model()¶
Create and initialize an NN model
- input_to_batches(inputs, batchSize)¶
Convert a list of inputs to a generator of batches.
- Parameters:
- inputs
list
[CutoutInputs
] Inputs to be scored.
- inputs
- Returns:
- batches
generator
Generator of batches of inputs.
- batches
- prepare_input(inputs)¶
Convert inputs from numpy arrays, etc. to a torch.tensor blob.
- Parameters:
- inputs
list
[CutoutInputs
] Inputs to be scored.
- inputs
- Returns:
- blob
Prepared torch tensor blob to run the model on.
- labels
Truth labels, concatenated into a single list.