<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Documentation EN</title><link>https://forge.codesys.com/lib/ml-iec-lib/wiki/Documentation%2520EN/</link><description>Recent changes to Documentation EN</description><language>en</language><lastBuildDate>Tue, 05 Oct 2021 10:12:14 -0000</lastBuildDate><atom:link href="https://forge.codesys.com/lib/ml-iec-lib/wiki/Documentation%20EN/feed" rel="self" type="application/rss+xml"></atom:link><item><title>Documentation EN modified by profgriesbauer</title><link>https://forge.codesys.com/lib/ml-iec-lib/wiki/Documentation%2520EN/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;What? Machine learning is an interesting topic for mechanical engineers, but is often difficult to tackle due to a lack of infrastructure and necessary hardware. This library was built to offer the basic software components required for machine learning in artificial neural networks (as used by Google, etc.) directly in IEC. So using this library one can use methods of machine learning on any SPS or controller programmable with CODESYS without the need for additional hardware.&lt;/p&gt;
&lt;p&gt;Who? Regardless of the fact that this library can be easily integrated into IEC on any controller, it still requires a basic understanding of machine learning. A book introducing to this topic in a basic and efficient manner is "Make Your Own Neural Network" by Tariq Rashid.&lt;/p&gt;
&lt;p&gt;How? For more efficient use, some FB blocks that reflect possible applications are prepared in the library. In addition, a simpler and a more complex example are implemented and offered along with the library.&lt;/p&gt;
&lt;p&gt;Why? The library is open source and can be changed or extended, whereas there is no guaranteed functionality or testing.&lt;/p&gt;
&lt;p&gt;Important: The library uses "Dynamic Memory". This option must be activated in the properties of the application: &lt;/p&gt;
&lt;p&gt;Examples:&lt;br/&gt;
•   MLNeuronalNetworkExample.project: The idea is to link any 16 inputs with a light system (red, yellow, green). The FB VariableNeuronalNetwork16To3 is used accordingly. At the push of a button, training data is generated and the network is trained, which can then be queried with a specific input configuration.&lt;br/&gt;
•   MLNeuronalNetworkComplexExample.project: The idea is to learn vibrational data (as amplitude-time data of length 2048) for anomaly detection. For this purpose, the FB AnomalieDetection2048 is used, which is configured in such a way that it first performs a fourier transformation on the data. Every cycle, training data of the simulated good state is generated, which is used to train the network. Every 10 runs, data of a simulated bad state is generated. In each case, the anomaly factor is displayed for comparison, along with a graphical output of the generated spectra.&lt;/p&gt;
&lt;p&gt;1 – Anomaly detection&lt;br/&gt;
Idea (Unsupervised Learning): A machine often provides data that characterise its condition. Normally the available data will mostly characterise the "good state" of the machine. Anomaly detection aims to know the good state very well, so that if a bad/different state occurs a changed anomaly factor signals such a change.&lt;br/&gt;
The function modules prepared for this have the name "AnomalieDetection&lt;span&gt;[...]&lt;/span&gt;" where &lt;span&gt;[...]&lt;/span&gt; is replaced by 64, 1024, an so on. The nomenclature implies by the number how large the input data array is, i.e. how many entries the array must have used for training or query. During the query, the FBs provide a REAL value as an anomaly factor, which indicates the "anomaly" of the data.&lt;/p&gt;
&lt;p&gt;Methods:&lt;br/&gt;
Initialize&lt;br/&gt;
       Initialisation of a neural network for anomaly detection&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   learningrate    REAL    Learning rate of the network&lt;br/&gt;
(default = 0.4, Recommendation: 0.3…0.5)&lt;br/&gt;
Input   doFFT   BOOL    TRUE: Input values are Fourier transformed&lt;br/&gt;
Input   doNormalize BOOL    TRUE: Input values are normalised&lt;br/&gt;
Input   doShuffleShift  BOOL    TRUE: The input values are shifted cyclically, randomly for training&lt;/p&gt;
&lt;p&gt;Train&lt;br/&gt;
       Train the neural network&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   trainData   ARRAY &lt;span&gt;[1..uiSize]&lt;/span&gt; OF REAL &lt;br/&gt;
       Note: uiSize = Number of data points (e.g. at AnomalieDetection2048 → uiSize = 2048)&lt;/p&gt;
&lt;p&gt;Query&lt;br/&gt;
       Query of the neural network for anomaly detection&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   queryData   ARRAY &lt;span&gt;[1..uiSize]&lt;/span&gt; OF REAL &lt;br/&gt;
       Note: uiSize = Number of data points (e.g. at AnomalieDetection2048 → uiSize = 2048)&lt;br/&gt;
File_Save_Weights&lt;br/&gt;
       Saving the configuration of a neural network at a specific time&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   Filename    STRING(255) File name of the current configuration&lt;/p&gt;
&lt;p&gt;File_Load_Weights&lt;br/&gt;
       Loading a previously saved network configuration&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   Filename    STRING(255) File name of the configuration to be loaded&lt;/p&gt;
&lt;p&gt;File_GetFileList&lt;br/&gt;
       Return a list with all saved configuration files&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   List    POINTER TO STRING(255)  STRING array into which the file list is written&lt;/p&gt;
&lt;p&gt;File_Delete_Weights&lt;br/&gt;
       Delete a specific configuration file&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   Filename    STRING(255) File name of the configuration to be deleted&lt;/p&gt;
&lt;p&gt;File_Delete_WeightsALL&lt;br/&gt;
       Delete all configuration files (no parameters)&lt;/p&gt;
&lt;p&gt;2 – Variable neural network&lt;br/&gt;
Idea (Supervised Learning): In many situations, the constellation of sensor values is used to recognise, for example, whether a component is good or bad. This classification takes place manually or within rough limits. A "classical neural network" can be used to classify such data automatically. In this case, any input values are assigned to certain predefined output values and the network is trained. The goal is to learn an estimate for the output values for unknown output values.&lt;br/&gt;
The function modules prepared for this have the name "VariableNeuronalNetwork&lt;span&gt;[...]&lt;/span&gt;" where &lt;span&gt;[...]&lt;/span&gt; is replaced by 1024To10, 16To3, and so on. The nomenclature implies how large the input data array (e.g. 16) and how long the output data array (e.g. 3) is. When queried, the FBs return an output data array that is interpreted according to the use case.&lt;/p&gt;
&lt;p&gt;Methods:&lt;br/&gt;
Initialize&lt;br/&gt;
       Initialisation of a variable neural network&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   learningrate    REAL    Learning rate of the network&lt;br/&gt;
(default = 0.4, Recommendation: 0.3…0.5)&lt;br/&gt;
Input   hiddenLayers    POINTER TO UINT Address of the array with the number of nodes of the respective layer&lt;br/&gt;
Input   hiddenTypes POINTER TO UINT Address of the array with the type code of the respective layer&lt;br/&gt;
Input   hiddenLayersCount   UINT    Number of hidden layers (without in- and outlayers)&lt;/p&gt;
&lt;p&gt;Train&lt;br/&gt;
       Training the variable neural network&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   InputTrain  POINTER TO REAL Address of the array with the train inputs&lt;br/&gt;
Input   TargetsTrain    POINTER TO REAL Address of the array with the train targets&lt;/p&gt;
&lt;p&gt;Query&lt;br/&gt;
       Querying the variable neural network&lt;br/&gt;
Validity area   Name    Type    Description&lt;br/&gt;
Input   InputQuery  POINTER TO REAL Address of the array with the query inputs&lt;br/&gt;
Input   OutputQuery POINTER TO REAL Address of an empty array with the query outputs&lt;/p&gt;
&lt;p&gt;Further methods for saving and loading network configurations:&lt;br/&gt;
-   File_Save_Weights&lt;br/&gt;
-   File_Load_Weights&lt;br/&gt;
-   File_Get_FileList&lt;br/&gt;
-   File_Delete_Weights&lt;br/&gt;
-   File_Delete_WeightsALL&lt;br/&gt;
For a description, see "1-Anomaly detection" above.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">profgriesbauer</dc:creator><pubDate>Tue, 05 Oct 2021 10:12:14 -0000</pubDate><guid isPermaLink="false">https://forge.codesys.com7a50da7e5f2e1df9bc67ffdebaa5952e31720ce9</guid></item></channel></rss>