TensorFlow Evaluator
The TensorFlow Evaluator processor uses a TensorFlow machine learning model to generate predictions or classifications of data. For information about supported versions, see Supported systems and versions.
Using the TensorFlow Evaluator processor, you can design flows that read data and then generate predictions or classifications of the data during the flow processing - producing data-driven insights in real time. For example, you can design flows that detect fraudulent transactions or that perform natural language processing as data passes through the flow.
To use the TensorFlow Evaluator processor, you first build and train the model in TensorFlow. You then save the trained model to file and store the saved model directory on the Data Collector machine that runs the flow.
When you configure the TensorFlow Evaluator processor, you define the path to the saved model stored on the Data Collector machine. You also define the input and output tensor information as configured during the building and training of the model.
You configure whether the processor evaluates each record or evaluates the entire batch at once. When evaluating the entire batch, the processor writes the prediction or classification results to events.
Prerequisites
Before you configure a TensorFlow Evaluator processor, complete the following prerequisites:
- Build and train the model in TensorFlow
- Build and train the model in TensorFlow. The processor uses version 1.15 of the TensorFlow client library and supports TensorFlow version 1.x.
- Save and store the trained model on the Data Collector machine
- Save the trained model to file in SavedModel format. When you save a model in
SavedModel format, TensorFlow creates a directory consisting of the following
subdirectories and
files:
assets/ assets.extra/ variables/ saved_model.pb
Evaluation method
The TensorFlow Evaluator processor can evaluate each record or evaluate the entire batch at once.
Configure the processor to use one of the following evaluation methods, based on the input that the tensor expects:
- Evaluate each record
- If the tensor requires one input to produce one output, configure the TensorFlow Evaluator processor to evaluate each record. By default, the processor evaluates each record, producing one output per record.
- Evaluate the entire batch
- If the tensor requires multiple inputs to produce one output, configure the TensorFlow Evaluator processor to evaluate the entire batch.
Event generation
When configured to evaluate the entire batch, the TensorFlow Evaluator processor can generate events. The events contain the results of the prediction or classification made for the batch.
- With a target to store event information.
For an example, see Preserving an audit trail of events.
For more information about dataflow triggers and the event framework, see Dataflow triggers overview.
Event records
| Record Header Attribute | Description |
|---|---|
| sdc.event.type | Event type. Uses the following event type:
|
| sdc.event.version | Integer that indicates the version of the event record type. |
| sdc.event.creation_timestamp | Epoch timestamp when the stage created the event. |
The TensorFlow Evaluator processor generates a tensorflow-event record when the processor completes processing all records in the batch. The event record is a Map field containing a field for each output configuration that you define for the processor.
Serving a TensorFlow model
If you include a TensorFlow Evaluator processor in a microservice flow, you can serve the TensorFlow model in the running flow.
When you serve a TensorFlow model, external clients can use the model to perform computations. In a microservice flow, a client makes a REST API call to the source. The microservice flow performs all processing - which can include the predictions or classifications made by the TensorFlow Evaluator processor. The records with the TensorFlow prediction or classification result are sent back to the microservice flow source. The source then transmits JSON-formatted responses back to the originating REST API client.
Configuring a TensorFlow Evaluator processor
About this task
Configure a TensorFlow Evaluator processor to use a TensorFlow machine learning model to generate predictions or classifications of data.