C# Class Microsoft.MSR.CNTK.Extensibility.Managed.CSEvalClient.ModelEvaluator

This class provides an Eval model wrapper to restrict model evaluation calls to one at a time.
This class is not thread-safe except through the static methods. Each ModelEvaluator instance wraps an Eval model, and exposes the Evaluate method for either a vector of inputs or a record string. The static interface provides the management of the concurrency of the models and restricts the evaluations to a single thread.
Show file Open project: Microsoft/CNTK Class Usage Examples

Private Properties

Property Type Description
Dispose void
EvaluateInput List
EvaluateRecord bool
ModelEvaluator System

Public Methods

Method Description
DisposeAll ( ) : void

Disposes of all models

Evaluate ( List inputs ) : List

Evaluated a vector and returns the output vector

Evaluate ( string record ) : bool

Evaluates a record containing the input data and the expected outcome value

Initialize ( int numConcurrentModels, string modelFilePath, int numThreads = 1 ) : void

Initializes the Model Evaluator to process multiple models concurrently

Private Methods

Method Description
Dispose ( ) : void

Disposes of the resources

EvaluateInput ( List inputs ) : List

Evaluates an input vector against the model as the first defined input layer, and returns the first defined output layer

EvaluateRecord ( string record ) : bool

Evaluates a test record

ModelEvaluator ( string modelFilePath, int numThreads, int id ) : System

Creates an instance of the ModelEvaluator class.

The id is used only for debugging purposes

Method Details

DisposeAll() public static method

Disposes of all models
public static DisposeAll ( ) : void
return void

Evaluate() public static method

Evaluated a vector and returns the output vector
public static Evaluate ( List inputs ) : List
inputs List The input vector
return List

Evaluate() public static method

Evaluates a record containing the input data and the expected outcome value
public static Evaluate ( string record ) : bool
record string A tab-delimited string with the first entry being the expected value.
return bool

Initialize() public static method

Initializes the Model Evaluator to process multiple models concurrently
public static Initialize ( int numConcurrentModels, string modelFilePath, int numThreads = 1 ) : void
numConcurrentModels int The number of concurrent models
modelFilePath string The model file path to load the model from
numThreads int
return void