XOR PARITY CLASSIFICATION


This example illustrates using a neural network as a classifier to classify a parity bit based on its input (A and B) as shown in below truth table.



The XOR data-set can be found in Examples-> Classification Example folder under ANNHUB installation folder.

This data-set contains training data-set (XORTraining.csv) used to train a neural network and test data-set (XORTest.csv) to test/evaluate the obtained trained neural network. The data structure contains 2 input features (Feature 1 to Feature 2) and 1 output class.


1. Design a neural network using ANNHUB

The step by step tutorial to design a neural network in ANNHUB can be found in ANNHUB help.


2. Export a trained neural network model to weight file.

When the trained neural network has been evaluated and tested with new test data-set, it can be exported into a weight file (.ann extension) using Export function in ANNHUB. Please refer to IRIS example to see how to export the trained neural network model to a file.


3. Using a trained neural network in LabVIEW environment using ANNAPI

At this stage, we already have a trained neural network saved in a text file with .ann extension (for example, TrainModel_lv.ann), we need to get the License Content by using valid username and password in GetLicenseContent.vi. Assume that we do not specify any License File Path in GetLicenseContent.vi, so this VI will generate the license content, ANNLV.lic, in the working directory.  

Note: We only need to get the license content only one time for a given target PC as this license content file can be used in other application running in the same PC.


With a trained neural network model and a license content, we can create a neural network model using Create.vi. Following block diagram demonstrates 5 steps to use ANNAPI to load a trained neural network and a license content file in order to create a neural network model and classify a parity bit based on its features (input).

Block diagram


Front Panel