May 2020
Intermediate to advanced
530 pages
17h 8m
English
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;
Read now
Unlock full access