RBTransiNetInterface#
- class lsst.meas.transiNet.RBTransiNetInterface(task, device='cpu')#
Bases:
objectThe interface between the LSST AP pipeline and a trained pytorch-based RBTransiNet neural network model.
Parameters#
- task
lsst.meas.transiNet.RBTransiNetTask The task that is using this interface: the ‘left side’.
- model_package_name
str Name of the model package to load.
- package_storage_mode{‘local’, ‘neighbor’}
Storage mode of the model package
- device
str Device to load and run the neural network on, e.g. ‘cpu’ or ‘cuda:0’
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.
Returns#
- scores
numpy.array Float scores for each element of
inputs.
- inputs
- 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.
Returns#
- batches
generator Generator of batches of inputs.
- inputs
- prepare_input(inputs)#
Convert inputs from numpy arrays, etc. to a torch.tensor blob.
Parameters#
- inputs
list[CutoutInputs] Inputs to be scored.
Returns#
- blob
Prepared torch tensor blob to run the model on.
- labels
Truth labels, concatenated into a single list.
- inputs
- task