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:
model_package_namestr

Name of the model package to load.

package_storage_mode{‘local’, ‘neighbor’}

Storage mode of the model package

devicestr

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.

init_model()

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:
inputslist [CutoutInputs]

Inputs to be scored.

Returns:
scoresnumpy.array

Float scores for each element of 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:
inputslist [CutoutInputs]

Inputs to be scored.

Returns:
batchesgenerator

Generator of batches of inputs.

prepare_input(inputs)

Convert inputs from numpy arrays, etc. to a torch.tensor blob.

Parameters:
inputslist [CutoutInputs]

Inputs to be scored.

Returns:
blob

Prepared torch tensor blob to run the model on.

labels

Truth labels, concatenated into a single list.