Architecture definition

First, we should define all the layers and connect them in the network. The layer can be defined as an object of the LinearModel class, parameterized with a specific activation function type. In our case, the type of the layer is as follows:

using DenseLayer = LinearModel<RealVector, TanhNeuron>;

To instantiate objects of this type, we have to pass three arguments to the constructor: the number of inputs, the number of neurons (outputs), and the Boolean value that enables a bias if it is equal to true. The >> operator can be used to connect all the layers in the network:

auto network = layer1 >> layer2 >> layer3 >> output;
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.189.251