dlpy.model.Model.predict

Model.predict(data, text_parms=None, layer_out=None, layers=None, gpu=None, buffer_size=10, mini_batch_buf_size=None, top_probs=None, use_best_weights=False, n_threads=None, layer_image_type=None, log_level=0, random_crop='none', random_flip='none', random_mutation='none', display_class_score_info='none')

Evaluate the deep learning model on a specified validation data set

Unlike the evaluate function, this function just does the inference and does not do further analysis. This function is good for non-classification tasks.

Parameters
datastring or CASTable, optional

Specifies the input data.

text_parmsTextParms, optional

Specifies the parameters for the text inputs.

layer_outstring, optional

Specifies the settings for an output table that includes layer output values. By default, all layers are included. You can filter the list with the layers parameter.

layerslist of strings

Specifies the names of the layers to include in the output layers table.

gpuGpu, optional

When specified, the action uses graphical processing unit hardware. The simplest way to use GPU processing is to specify “gpu=1”. In this case, the default values of other GPU parameters are used. Setting gpu=1 enables all available GPU devices for use. Setting gpu=0 disables GPU processing.

buffer_sizeint, optional

Specifies the number of observations to score in a single batch. Larger values use more memory. Default: 10

mini_batch_buf_sizeint, optional

Specifies the size of a buffer that is used to save input data and intermediate calculations. By default, each layer allocates an input buffer that is equal to the number of input channels multiplied by the input feature map size multiplied by the bufferSize value. You can reduce memory usage by specifying a value that is smaller than the bufferSize. The only disadvantage to specifying a small value is that run time can increase because multiple smaller matrices must be multiplied instead of a single large matrix multiply.

top_probsint, optional

Specifies to include the predicted probabilities along with the corresponding labels in the results. For example, if you specify 5, then the top 5 predicted probabilities are shown in the results along with the corresponding labels.

use_best_weightsbool, optional

When set to True, the weights that provides the smallest loss error saved during a previous training is used while scoring input data rather than the final weights from the training. default: False

n_threadsint, optional

Specifies the number of threads to use. If nothing is set then all of the cores available in the machine(s) will be used.

layer_image_typestring, optional

Specifies the image type to store in the output layers table. JPG means a compressed image (e.g, jpg, png, and tiff) WIDE means a pixel per column Default: jpg Valid Values: JPG, WIDE

log_levelint, optional

specifies the reporting level for progress messages sent to the client. The default level 0 indicates that no messages are sent. Setting the value to 1 sends start and end messages. Setting the value to 2 adds the iteration history to the client messaging. default: 0

random_flipstring, optional

Specifies how to flip the data in the input layer when image data is used. H stands for horizontal V stands for vertical HW stands for horizontal and vertical Approximately half of the input data is subject to flipping. Default: NONE Valid Values: NONE, H, V, HV

random_cropstring, optional

Specifies how to crop the data in the input layer when image data is used. Images are cropped to the values that are specified in the width and height parameters. Only the images with one or both dimensions that are larger than those sizes are cropped. UNIQUE: specifies to crop images to the size specified in the height and width parameters. Images that are less than or equal to the size are not modified. For images that are larger, the cropping begins at a random offset for x and y. Default: NONE Valid Values: NONE, UNIQUE

random_mutationstring, optional

Specifies how to mutate images. Default: NONE Valid Values: NONE, RANDOM

display_class_score_info: string, optional

When set to ALL, displays the ClassScoreInfo table in the results. Default: NONE Valid Values: NONE, ALL

Returns
CASResults