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’
- task
 
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.