C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
Dispose void
EvaluateInput List
EvaluateRecord bool
ModelEvaluator System

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

DisposeAll() публичный статический Метод

Disposes of all models
public static DisposeAll ( ) : void
Результат void

Evaluate() публичный статический Метод

Evaluated a vector and returns the output vector
public static Evaluate ( List inputs ) : List
inputs List The input vector
Результат List

Evaluate() публичный статический Метод

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.
Результат bool

Initialize() публичный статический Метод

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
Результат void