TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Implementation of [Multilayer Perceptron] (https://en.wikipedia.org/wiki/Multilayer_perceptron). More...
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <valarray>
#include <vector>
#include "vector_ops.hpp"
Go to the source code of this file.
Classes | |
class | machine_learning::neural_network::layers::DenseLayer |
class | machine_learning::neural_network::NeuralNetwork |
Namespaces | |
namespace | machine_learning |
A* search algorithm | |
namespace | neural_network |
Neural Network or Multilayer Perceptron. | |
namespace | activations |
Various activation functions used in Neural network. | |
namespace | util_functions |
Various utility functions used in Neural network. | |
namespace | layers |
This namespace contains layers used in MLP. | |
Functions | |
double | machine_learning::neural_network::activations::sigmoid (const double &x) |
double | machine_learning::neural_network::activations::dsigmoid (const double &x) |
double | machine_learning::neural_network::activations::relu (const double &x) |
double | machine_learning::neural_network::activations::drelu (const double &x) |
double | machine_learning::neural_network::activations::tanh (const double &x) |
double | machine_learning::neural_network::activations::dtanh (const double &x) |
double | machine_learning::neural_network::util_functions::square (const double &x) |
double | machine_learning::neural_network::util_functions::identity_function (const double &x) |
static void | test () |
int | main () |
Main function. | |
Implementation of [Multilayer Perceptron] (https://en.wikipedia.org/wiki/Multilayer_perceptron).
A multilayer perceptron (MLP) is a class of feedforward artificial neural network (ANN). The term MLP is used ambiguously, sometimes loosely to any feedforward ANN, sometimes strictly to refer to networks composed of multiple layers of perceptrons (with threshold activation). Multilayer perceptrons are sometimes colloquially referred to as "vanilla" neural networks, especially when they have a single hidden layer.
An MLP consists of at least three layers of nodes: an input layer, a hidden layer and an output layer. Except for the input nodes, each node is a neuron that uses a nonlinear activation function. MLP utilizes a supervised learning technique called backpropagation for training. Its multiple layers and non-linear activation distinguish MLP from a linear perceptron. It can distinguish data that is not linearly separable.
See Backpropagation for training algorithm.
Definition in file neural_network.cpp.
double machine_learning::neural_network::activations::drelu | ( | const double & | x | ) |
Derivative of relu function
X | Value |
Definition at line 81 of file neural_network.cpp.
double machine_learning::neural_network::activations::dsigmoid | ( | const double & | x | ) |
Derivative of sigmoid function
X | Value |
Definition at line 67 of file neural_network.cpp.
double machine_learning::neural_network::activations::dtanh | ( | const double & | x | ) |
Derivative of Sigmoid function
X | Value |
Definition at line 95 of file neural_network.cpp.
double machine_learning::neural_network::util_functions::identity_function | ( | const double & | x | ) |
Identity function
X | Value |
Definition at line 112 of file neural_network.cpp.
int main | ( | void | ) |
Main function.
Definition at line 833 of file neural_network.cpp.
double machine_learning::neural_network::activations::relu | ( | const double & | x | ) |
Relu function
X | Value |
Definition at line 74 of file neural_network.cpp.
double machine_learning::neural_network::activations::sigmoid | ( | const double & | x | ) |
Sigmoid function
X | Value |
Definition at line 60 of file neural_network.cpp.
double machine_learning::neural_network::util_functions::square | ( | const double & | x | ) |
Square function
X | Value |
Definition at line 106 of file neural_network.cpp.
double machine_learning::neural_network::activations::tanh | ( | const double & | x | ) |
Tanh function
X | Value |
Definition at line 88 of file neural_network.cpp.
|
static |
Function to test neural network
Definition at line 805 of file neural_network.cpp.