◆ NeuralNetwork() [1/2]
Constructs a neural network with the given parameters.
- Parameters
-
layers | a vector of the layers comprising the network. |
loss_func | a loss_t enumerant describing the loss function to use at the end of the network. |
optimizer | a optimizer_t enumerant describing the optimizer to use in training. |
params | a set of neural network parameters. |
◆ NeuralNetwork() [2/2]
Constructs a neural network. Allows you to supply custom optimizer.
- Parameters
-
layers | a vector of the layers comprising the network. |
loss_func | a loss_t enumerant describing the loss function to use at the end of the network. |
optim | Optimizer<T> that will be used to optimize the network |
params | a set of neural network parameters. |
◆ fit()
Trains this neural network using x and y. The batch size and epochs are used from the model parameters given during construction. If verbose, then training info is printed periodically.
- Parameters
-
x | independent data |
y | ground truth one-hot encoded data |
metric_out | [out] metric to write training metrics in |
verbose | if true, run in verbose mode |
- Returns
- magmadnn_error_t 0 on success
Implements magmadnn::model::Model< T >.
◆ predict()
return a one-hot encoded output of the network on this sample
- Parameters
-
- Returns
- Tensor<T>* one-hot encoded prediction
Implements magmadnn::model::Model< T >.
◆ predict_class()
This is equivalent to math::argmax(predict(sample)), where the one-hot encoded predict value is used.
- Parameters
-
- Returns
- unsigned int the index of the predicted class.
Implements magmadnn::model::Model< T >.
The documentation for this class was generated from the following files: