1 function net_int = train_2_layers(s,r)
2 %function takes sample data an trains a neural network to aaproximate the
3 %integral used to compute the fuel fraction.
5 % s -- samples from gauss_samps(1000,0.8), etc
6 % r -- responses from fuel_quad(s,50), etc
8 %create CNN with two hidden layers of size 10
9 net_int = feedforwardnet([10 10])
11 %sigmoid activation function is used by default, but may be changed
12 %poslin --> ReLu activation function
13 %net_int.layers{1}.transferFcn = 'poslin';
14 %net_int.layers{2}.transferFcn = 'poslin';
16 %train the network on the data
17 [net_int, train_int] = train(net_int,s,r);