![]() |
MeLOn
|
MeLOn supports two options for training feed forward neural networks:
It is recommended that you rely on the provided example scripts for training your model. The reason for this is that MeLOn doesn't support all function included in keras or the Matlab Machine Learning Toolbox and by using the examples you can assure to generate models which are compatible with the MeLOn functionalities.
The two training script included provide you with the following options:
To use the scripts on your data you have to provide it in a .csv file where each row contains a data point with the first columns containing the values of the input and the following columns containing the ones of the output.
Example:
Further, you have to set the file path to your csv and the variables containing your in- and output dimensions in the script file.
Example:
The variables containing the values of training parameters and basic network structure can be found under the section SET PARAMETERS
within the training script. You are free to set the according to your requirements. Please notice the restriction for activation functions in the next section.
The scripts will generate an xml file containing the network data which you have to provide to MeLOn in your C++ program.
You are also free to write your own script. As the C++ part of MeLOn only is compatible with a subset of the features contained in keras there are a few restrictions you have to keep in mind when writing your training script:
Scaling: For scaling the in- and output values you have to use the following functions from utils.py
:
scale
for input variables. This function implements a min-max normalization to the range [-1,1].normalize
for output variables. This function implements a standardization .You can also choose not to use scaling on either of these.
save_model_to_xml
function from utils.py
The training script gives you an example of how to train a feedforward neural network in Matlab using the feedforwardnet
implementation from the Deep Learning Toolbox. In the example, the training data is generated in the script, but you can also load the data using your preferred method and then use it for training by calling the configuration
function for your network. To save the trained network you have to use the sNetwork2CSV
function which is located in feedforward neural network\training\matlab\Write ANN to files\sNetwork2CSV.m
.
Restrictions for training with Matlab:
purelin
tansig
To include the trained network in your MAiNGO problem formulation you can use the MeLOn C++ interface. An example of how to include a feed forward neural network in your optimization can be found in the MAiNGO folder.