Matrix format
From Piki
The matrix format is a special input format that can be used for deployed systems. It allows direct programmatic entry of data into the sytem
| Matrix format | |
| N/A | |
| Deployable | Yes |
| Type | Memory |
Contents |
Usage
While systems are usually trained with data from a database or from a file, deployed systems have usually a different requirement for data input. Usually programmatic input without any intermediate forms is required. The matrix format fulfills this role.
When deploying a system using the deployment processor the matrix format is set a default on all data units:
| Matrix input format selection. |
|---|
|
To disable this feature and to use the regular format of the data unit, uncheck the UDF ("Use Deploy Format") checkbox.
Programmatic access
Once the system is deployed, there are three ways of inputting data. Suppose the deployed system is called "sys" and that it contains a data unit called "CSV". Unlike other formats, the matrix format gets integrated directly into the main programmatic interface of the deployed component.
Individual values
To add a sample by adding values individually, parameter by parameter use the Set_CSV method (if your data unit is called XYZ the method will be called Set_XYZ). Intellisense will guide you through telling you the parameters in order.
Supose the data unit has five features (x,y,z,u,w). The Set_CSV method will then have the following format:
Set_CSV(double x, double y, double z, double u, double w)
To input data you then just enter the desired values:
sys.Set_CSV(1, 2, 3, 4, 3.14)
When there is a large number of parameters the individual values method is disabled.
Double array
To add a sample by adding an array of values at once you use the same sys.Set_CSV method, but with a different argument:
Set_CSV(double[] data)
Or as it looks when you call the method:
double[] data = new double{ 1, 2, 3, 4, 3.14}; sys.Set_CSV(data)
Intellisense will guide you by telling you the required size of the double array.
Multiple samples
If you wish to add multiple samples at once you can use the Input_CSV property of the system (if your data unit is called XYZ, it will be called Input_XYZ). It takes a Peltarion.Maths.Matrix object as input:
using System; using Peltarion.Deployed; using Peltarion.Maths; namespace Test { class Program { static void Main(string[] args) { DeployedSys sys = new DeployedSys (); Matrix m = new Matrix(10, 5); //10 rows, 5 features m.Randomize(); //randomize matrix sys.Input_CSV = m; //set the data sys.StepEpoch(); //run system } } }
Training and validation
By default all data is treated as training data, though the control system is by default deployed with learning switched off. If you need to specify that the data is validation data, use the SetSignal(Matrix m, SetType set) method.
See also
- Input format - Article covering input formats in general.
- Data unit - Article covering the data unit fundamentals.
- List of Input format components - List of all available input format components.

