How PerceptiLabs Works With TensorFlow

PerceptiLabs is built on top of TensorFlow and Keras, and provides a visually-intuitive user interface (UI) that assists you with building TensorFlow-based machine learning models.

This topic provides existing TensorFlow users with details on how PerceptiLabs uses TensorFlow, and the correlation between visual modeling and the underlying TensorFlow code.

Visual Modeling

PerceptiLabs' Modeling Tool provides a dataflow-driven, visual API for TensorFlow. This visual API wraps low-level TensorFlow code in visual Components, which allows you to visualize the model architecture while you build your model.

One of the greatest aspects of PerceptiLabs' visual approach is that you can ease into the customization of your model based on your requirements and/or skill level.

In PerceptiLabs' Modeling Tool, you drag and drop Components on a workspace for each layer you want to include in your model and connect them together. This visual, drag-and-drop approach provides a number of benefits:

  • View of the overall model architecture.

  • Granular visualizations during the modeling phase, run-time, and testing.

  • Debugging and diagnostic features.

  • Automatic suggestions for configs/settings and hyperparameters.

  • Dimensionality and I/O shape fitting.

  • Low-code Component customizations.

PerceptiLabs automatically generates the code for each Component you add to your model and assigns "good" hyperparameter values as you connect them together. You can then tweak these settings as required. You also have the option to view and edit this autogenerated code including both the hyperparameter values and the logic.

Layers as Components

Since models are built visually in PerceptiLabs, the layers of a model are represented using Deep Learning Components in PerceptiLabs' Modeling Tool. You can also optionally add Processing, Operations, and Custom Components to transform data between these layers. The model's Input and Target components are hard-coded into the model by PerceptiLabs to define the input data and output predictions respectively.

Fundamentals of Components

Each Component in your model represents an auto-generated class written in Python, which implements that Component's logic with TensorFlow. You can view and edit a Component's code via the Code Editor as described in Modifying a Component's Code.

Class Naming Convention

The name of a Component's auto-generated class encodes the Component's category, Component type, and an instance name, appended with the instance number. The instance number corresponds to when the component was added to the model in relation to other Components of the same type. For example, the following is a code snippet from a Reshape Component in a model:

class ProcessReshape_Reshape_2Keras(tf.keras.layers.Layer):

The class name can be broken down as follows:

  • Process: the name of the category (e.g., Deep Learning, etc.) which that Component is available under.

  • Reshape: the type of the Component.

  • Reshape_2: the name of the Component instance. In this example, 2 means it was the second Reshape Component instance added to the model.

  • Keras: indicates that this implementation is based on Keras.

Elements of the Component Class's Interface

Each Component's class derives from a PerceptiLabs-defined parent class, that defines the interface required for PerceptiLabs' training script to invoke operations and pass results onto subsequent Components. PerceptiLabs will regenerate this class when changes are made in the Component's Settings pane.

A layer Component implements tf.keras.layers.Layer that defines an interface (i.e., the functions and properties) for the layer with the following:

  • visualized_trainable(): returns the layer's weights and biases to be updated during training.

  • __init__(): the class's constructor.

  • call(): invoked by PerceptiLabs when you run the model. This is likely to be the only method that you would modify if you're customizing the class's algorithm.

  • build(): creates the layer's weights based on its shape.

  • get_config(): returns any properties that are to be accessible in PerceptiLabs' UI.

Last updated