Assigning Bindings
  • 26 Sep 2024
  • 2 Minutes to read
  • Dark
    Light

Assigning Bindings

  • Dark
    Light

Article summary

Bindings are how an AI model ties in with your control system. These are configured from the Bindings tab inside of a model’s detail page. The binding tab give a live view of all of the model’s bindings and what values are being fed in and out of the model.

Input vs Output

When binding tags to a model, it’s important to keep the tag’s usage in mind. A tag that has been assigned a usage of “Input” will be read-only from the device and therefore will only be used as an input binding into the model. A tag that has a usage of “Output” is read/write, meaning it can be bound to a model’s output binding and an input binding. This is commonly done in model schemes where the output of the model needs to be fed back into the model or into a different model’s input.

Binding a Tag

By default, all of the bindings will say unassigned. Click on the binding you would like to tie to a tag, making careful note of which number binding you are wanting to tie into the model. This should line up with the tag that was used in that position while training. Clicking on an unassigned binding will take you to the Binding Settings form.

From here, use the tag dropdown list to assign an appropriate tag to the binding. Below we will go into detail on how normalization and failure ranges are used.

Normalization

It is typical for ML engineers to normalize their data between 0-1 when training a model. Koios gives you flexibility in how you would like to normalize your data. Choose from the following options when configuring a binding.

Normalize To Tag Range

The value will be normalized using the Range Min and Range Max configured in the tag’s settings.

Value Normalized In Device

This will assume that the value is already normalized in the end device. No changes are made to the value when this mode is selected.

Normalize To Custom Range

This gives you the ability to put in a custom minimum and maximum value to normalize to.

Custom Failure Range

When training a model, there is typically a limit to the range of the data that was used to validate the model. Any data used to make a prediction outside of this range could be considered dangerous to allow. The model can not be trusted because it has not been validated to predict here. By default, Koios will fail a model if a binding’s tag value strays outside of the normalization range, but there are many cases where you would like to tighten up this tolerance to some known value from training. To do this, check the box that says Custom Failure Range. This will reveal the following two fields.

Failure Minimum

Custom value that will fail the model if the binding’s tag value goes under it.

Failure Maximum

Custom value that will fail the model if the binding’s tag value goes over it.

Allowed Missed Samples (Advanced)

By default, Koios will allow 5 missed samples from a data stream before it fails the model. This can be made more or less strict using this field. For example, if a model has a sample rate of 1 second, Koios will allow a sample that is 4 seconds old but fail the model if a new data point hasn’t been read in the next second. This prevents the model from trying to make predictions on old data or with insufficient amounts of data.