MeLOn
example_training_of_ANN.m File Reference

Typedefs

using X = lhsdesign(nX,DX)
 

Functions

Training function (Levenberg Marquardt) ffNet
 
View network view (ffNet) %% Save ANN parameters in csv-files % We write csv-files that is read by our MAiNGO model. sNetwork2CSV(ffNet)
 
Compute GP predictions in Matlab (just for information) x_Test_Point
 
Plot generated data (just for information) % Generate a mesh on the inputs[x_1_prediction
 
 x_2_prediction (i, j)]
 
 y_prediction (i, j)
 

Variables

file example_training_of_GP m brief Illustrative training script for feedforward artificial neural network in Matlab
 
file example_training_of_GP m brief Illustrative training script for feedforward artificial neural network in RWTH Aachen University n
 
Add path for Gaussian process export functions General nX = 200
 
Number of training data points DX = 2
 
Input dimension of data GP lb = [-3, -3]
 
Define Lower bound of inputs ub = [ 3, 3]
 
Define upper bound of inputs test_func
 
Scale inputs onto interval[lb, ubY = cellfun(test_func, num2cell(X,2))
 
Evaluate test_func for all X Tranining of ANNs numNeurons = [10,8]
 
 trainFcn = 'trainlm'
 
 ffNet = configure(ffNet, X',Y')
 
Transfer function
 
Transfer purelin
 
Transfer ffNet layers {1}.transferFcn = 'tansig'
 
Output Layer ffNet name = 'myTestANN'
 
Devide data set into training
 
Devide data set into validation
 
Devide data set into and test ffNet divideParam trainRatio = 70/100
 
ffNet divideParam valRatio = 15/100
 
ffNet divideParam testRatio = 15/100
 
ffNet divideFcn = 'divideblock'
 
ffNet performParam normalization = 'standard'
 
Training Parameters ffNet trainParam epochs = 50000
 
ffNet trainParam max_fail = 6
 
ffNet trainParam min_grad = 1e-07
 
ffNet trainParam mu_max = 1e10
 
 prediction = ffNet(x_Test_Point)
 
 perf = perform(ffNet,prediction,Y)
 
Plot generated x_2_prediction = meshgrid(linspace(lb(1), ub(1), 20), linspace(lb(2), ub(2),20) )
 
 y_prediction = zeros(size(x_2_prediction,1),1)
 
 y_std = zeros(size(x_2_prediction,1),1)
 
Evaluate prediction at all mesh points for i
 

Typedef Documentation

◆ X

data X = lhsdesign(nX,DX)

Function Documentation

◆ data()

Plot generated data ( just for  information)

◆ function()

Training function ( Levenberg  Marquardt)

◆ Matlab()

Compute GP predictions in Matlab ( just for  information)

◆ view()

View network view ( ffNet  )

◆ x_2_prediction()

x_2_prediction ( i  ,
j   
)

◆ y_prediction()

y_prediction ( i  ,
j   
)

Variable Documentation

◆ divideFcn

ffNet divideFcn = 'divideblock'

◆ DX

if DX = 2

◆ epochs

Training Parameters ffNet trainParam epochs = 50000

◆ ffNet

ffNet = configure(ffNet, X',Y')

◆ function

return function
Initial value:
= TrainingOfGP(Xnew,Ynew,OptGP)
% Copyright (c) by Eric Bradford

◆ i

for i
Initial value:
= 1 : size(x_1_prediction,1)
for j = 1 : size(x_2_prediction,1)
x_Test_Point = [x_1_prediction(i,j)

◆ layers

ffNet layers {1}.transferFcn = 'tansig'

◆ lb

Input dimension of data GP lb = [-3, -3]

◆ Matlab

file example_training_of_GP m brief Illustrative training script for feedforward artificial neural network in Matlab
Initial value:
==============================================================================\n
% Aachener Verfahrenstechnik-Systemverfahrenstechnik

◆ max_fail

ffNet trainParam max_fail = 6

◆ min_grad

ffNet trainParam min_grad = 1e-07

◆ mu_max

ffNet trainParam mu_max = 1e10

◆ n

file example_training_of_GP m brief Illustrative training script for feedforward artificial neural network in RWTH Aachen University n
Initial value:
==============================================================================\n
%
% @author Artur Schweidtmann and Alexander Mitsos
% @date 22. January 2020
%%
clc
clear all
close all
addpath("Write ANN to files")

◆ name

Output Layer ffNet name = 'myTestANN'

◆ normalization

ffNet performParam normalization = 'standard'

◆ numNeurons

Evaluate test_func for all X Tranining of ANNs numNeurons = [10,8]

◆ nX

Add path for Gaussian process export functions General nX = 200

◆ perf

perf = perform(ffNet,prediction,Y)

◆ prediction

prediction = ffNet(x_Test_Point)

◆ purelin

Transfer purelin

◆ test_func

Define upper bound of inputs test_func
Initial value:
= @(x) 3*(1-x(1)).^2.*exp(-(x(1).^2) - (x(2)+1).^2) ...
- 10*(x(1)/5 - x(1).^3 - x(2).^5).*exp(-x(1).^2-x(2).^2) ...
- 1/3*exp(-(x(1)+1).^2 - x(2).^2)

◆ testRatio

ffNet divideParam testRatio = 15/100

◆ trainFcn

trainFcn = 'trainlm'

◆ training

Devide data set into training

◆ trainRatio

Devide data set into and test ffNet divideParam trainRatio = 70/100

◆ ub

Define Lower bound of inputs ub = [ 3, 3]

◆ validation

Devide data set into validation

◆ valRatio

ffNet divideParam valRatio = 15/100

◆ x_2_prediction

Plot generated x_2_prediction = meshgrid(linspace(lb(1), ub(1), 20), linspace(lb(2), ub(2),20) )

◆ Y

Scale inputs onto interval [lb, ub] Y = cellfun(test_func, num2cell(X,2))

◆ y_prediction

y_prediction = zeros(size(x_2_prediction,1),1)

◆ y_std

y_std = zeros(size(x_2_prediction,1),1)
c
end c
Definition: Train_GP_and_return_hyperparameters.m:243
OptGP
id OptGP()
i
Evaluate prediction at all mesh points for i
Definition: example_training_of_ANN.m:98
addpath
file example_training_of_GP m brief Illustrative training script for Gaussian processes in RWTH Aachen University Xiaopeng Daniel and Alexander Mitsos date January clc clear all close all addpath("Direct")
n
file example_training_of_GP m brief Illustrative training script for feedforward artificial neural network in RWTH Aachen University n
Definition: example_training_of_ANN.m:9
x_2_prediction
Plot generated x_2_prediction
Definition: example_training_of_ANN.m:91
size
Xnew size()
Ynew
scaled inputs Ynew
Definition: ScaleVariables.m:6
Xnew
id Xnew()
j
Training of GP for j
Definition: Train_GP_and_return_hyperparameters.m:24