The classifier is a neural network, at each step it takes the current [configuration](readingMachine.md) as input and predicts the next [transition](transitionSet.md) to take.
The classifier must be defined in the [Reading Machine](readingMachine.md) file.\
It's definition is made of three parts :
* In the first part we have to define :
* A name.
* For each state, what is the [Transition Set](transitionSet.md) file associated to it.
* For each state, we can specify a scalar for the training loss function to be multiplied by. Default value is 1.0.
* The network type : Random (no neural network) or Modular (see below).
* In the second part we must define the feature function and architecture of the neural network, see below for complete overview of Modular network type. This part must be ended with the line 'End'. Example :
* In the third part, we must define the hyperparameters of the optimizer algorithm. Currently available optimizers are :
* Adam {learningRate beta1 beta2 epsilon weightDecay useAMSGRAD}
Example :
```
Optimizer : Adam {0.0002 0.9 0.999 0.00000001 0.00001 true}
}
```
## Network type : Random
The predictions will be chosen at random. There is no parameters to be learned.\
The purpose of this network type is to debug a [Reading Machine](readingMachine.md) topology, because it is very fast.\
There is nothing to define, you can put the 'End' line just after the line 'Network type : Random'.
## Network type : Modular
Each line of the definition of the Modular network type correspond to a module.\
The order of the modules in the definition are not important, you can also use a module multiple times.\
There are two mandatory modules :
*`MLP : {Layer1Size Layer1Dropout...}`\
Definition of the Multi Layer Perceptron, that will take as input the concatenation of the outputs of all other modules, and will act as the output layers of the neural network.\
The last layer (output layer) is not part of the definition because its size is dynamically deduced from the number of outgoing transitions of the current state. Thus you only need to define the hidden layers of the MLP.\
Example to define a MLP with 2 hidden layers of respective sizes 2048 and 1024 and of respective dropouts 0.3 and 0.1 :
```
MLP : {2048 0.3 1024 0.1}
```
*`InputDropout : scalar`\
Dropout (between 0.0 and 1.0) to apply to the input of the MLP.
Example `InputDropout : 0.5`
And then there is a list of optional modules you can choose from :
*`StateName : Out{embeddingSize}`\
An embedding of size *embeddingSize* representing the name of the current state.