GenSynth Documentation

Creating New Entities

Before you can use GenSynth to analyze a neural network model, you must define entities for the data that will be used to train, validate, and test the model; for the network save files, inputs, outputs, and other properties; and for performance metrics measuring the success of the model on your specific problem domain.

Creating a Dataset Entity

A Dataset Entity defines the presentation of this data to GenSynth. You must write or obtain Python code to implement the required interface.

When you click on the Entities tab, you are given the option to create your dataset. Selecting Dataset will take you to the Dataset Manager.

On this page you will create or update the datasets you will use with GenSynth.

dataset_manager1.png

If you already have a dataset and wish to update it, select it from the drop-down. Choose the entity version you want to view from the corresponding drop-down. The file contents will appear in the black area.

You can only update the Draft version of the document. If you want to update a version, select the version you want from the drop-down and click the Revert button.

revert_button.png

This will make the version the Draft, and allow you to make changes. Click the Save icon to save your changes.

Once the Draft has been updated and saved, you will need to tell it to Validate. If your version updates successfully, you can then Publish it.

publish_button.png

Note

You can save your entity version at any time, allowing you to leave and come back to it before validating or publishing.

Publishing creates a new version with the next available version number. The highest version number is the one made available to you in the New Job tab.

Tip

DarwinAI provides samples you can use to start with or to modify to suit your needs. If you alter them, we recommend saving them with a new filename as installing updates to the samples will overwrite your changes.

If you are creating an entirely new dataset, you will need to write the code in the black text space. If you need help creating the code, refer to the GenSynth Data Preparation Guide .

Tip

The dataset creation window uses IntelliSense to help you speed up the creation of the dataset interface.

Once you have your dataset in place, click the Validate button to check for errors. This is a mandatory step.

When the validation is complete, GenSynth will show you the number of errors and warnings it has found; you can tell at a glance what the state of your dataset is.

If you click on the clipboardimage72.pngicon, you will get a report showing you exactly where any errors are located. It will also outline anything that GenSynth considers suspicious as a warning, and where those questionable lines are located.

image75.png

To dismiss the report, press Esc or click on any part of the screen that is not the report window.

If all is well, save your entity and Publish it to make it available in the Entities section of the New Job page.

You can delete your dataset by clicking on the trash can icon. This deletes the entire dataset. You cannot delete versions, but you can roll back to any previous version.

Creating a Model Entity

Before you can start a job, you must define the neural network model as a "Model Entity". At this phase you specify the location of the saved model and weights, and define various aspects of the model such as outputs, loss tensor, and other metrics.

When you click on the Entities tab, you are given the option to create your model entity. Selecting Model will take you to the Model Manager.

A model entity represents a network along with a number of parameters describing the network.

model_manager_2.png

If you are updating an existing model entity, select it from the drop-down. You will need to select the version from the corresponding drop-down. If you have never published a version of the entity, your only choice will be Draft.

If you are updating a version of your entity , select it from the drop-down. You will then need to choose the entity version you want from the corresponding drop-down. If you have not versioned the entity, your only choice will be Draft. The file contents will appear in the black area.

You can only update the Draft version of the document. If you want to update a version, select the version you want from the drop-down and click the Revert button.

revert_button.png

This will make the version the Draft, and allow you to make changes.

There are several ways of specifying model files:

  • Single-graph meta and checkpoint: the same model from the meta-graph file is used for training and testing.

  • Multi-graph meta and checkpoint: a different graph is used for each of training and testing phases. The graphs must be compatible such that they are able to load the same weights (checkpoint).

  • HDF5: a single file defines the graph and weights, in the HDF5 format commonly used by tf.keras.

Select the appropriate save type and multi-graph selector.

When you enter your save file locations you must click on the Load Tensor Data button to continue. GenSynth will take several seconds to load and analyze the model file(s).

If your data does not load correctly you will receive an error message.

image55.png

If you click on View Results within that error message or the Load Results clipboard icon, you will see more details about the failure.

image70.png

If your data loads correctly, you will be able to complete the remaining fields. You must specify Input, Output, and Loss Tensors from the drop-downs.

model_manager_3.png

These are the fields available to you on this tab.

Variable

Description

Save Type

Select the type of file you want to save your model as. Your choices are Meta & Checkpoint or HDF5 (tf.keras).

Note: GenSynth may not support all tf.keras models at this time. Contact your DarwinAI representative for details.

Multi-Graph Architecture

This feature allows a model to have distinct training and evaluation (inference) architectures. (Contact DarwinAI for more details). Available if save type is Meta & Checkpoint.

Metafile Location

An absolute or relative path to the TensorFlow metagraph file containing the original saved model to be trained. This file usually has the.meta extension. (Available if multi-graph architecture is disabled.)

HDF5 File Location

An absolute or relative path to the TensorFlow HDF5 file containing the saved model and weights. Available if the save type is HDF5.

Checkpoint Folder

An absolute or relative path to the folder containing a TensorFlow saved checkpoint. This folder will contain a file called checkpoint as well as a model-xx.index file, and one or more model-xx.data-xxxxx-of-xxxxx files. (Available if Save Type is Meta & Checkpoint.)

Evaluation Metafile Location

An absolute or relative path to the TensorFlow metagraph file containing the original saved evaluation model to be trained. This file usually has the.meta extension.(Available if multi-graph architecture is enabled.)

Input Tensor

The names of the tensors that are inputs to the network, to be fed values from the dataset.

Output Tensor

The tensors of the network that are considered outputs for inference. These outputs will neither be removed nor reshaped by GenSynth.

Loss Tensor

The name of the tensor you want to minimize in training, suitable for use with a TensorFlow optimizer.

Training Placeholder Tensor

The name of a scalar tensor that should be set to 1 during training and 0 during inference. If no such tensor exists, leave blank.

Runtime Variables

Non-trainable variables used for metrics calculation or for internal calculations. These variables will not be converted to constants when a graph is frozen.

Metrics

You may collect other metrics by listing them here.

For each metric, provide:

  • Name: Display name of metric

  • Tensor: The name of the TensorFlow Tensor providing this metric.

  • Calculate Mean: True if the system should compute the average across batches; false if the operation does so internally.

Once the Draft has been updated and saved, you will need to tell it to Validate. If your version updates successfully, you can then Publish it.

publish_button.png

Once an entity has been published, it will be available to you in the Entities section of the New Job page.

Creating Performance Metrics

When you click on the Entities tab, you are given the option to create your performance metrics. Selecting Performance Metric will take you to the Performance Metric Manager.

A performance metric entity allows you to write arbitrary measures of validation and test performance in Python3. Measuring performance this way is optional; you may prefer to provide a tensor that measures performance.

On this page you will create or update the performance metrics you will use with GenSynth.

performance_metric_manager_1.png

If you already have a performance metric file and wish to update it, select it from the drop-down. If you wish to update a particular version of your entity, select it from its respective drop-down. You must then revert it to make it the Draft version. You can only update and save the version that is currently the Draft.

The file contents will appear in the black area. Once you have updated and saved it as desired, Publish the Draft to make that the version available to you in the Network section of the New Job tab.

If you are creating an entirely new performance metric file, you will need to write the code in the black text space. If you need help creating the code, refer to the GenSynth Preparation Guide. You will also have to fill in the Performance Metric Interface Class, Input Keys, and Output Keys.

Tip

The performance metric creation window uses IntelliSense to help you speed up the creation of the custom metric file.

Once you have published your file, it will be available in the drop-down in the Network section of the New Job tab.