# What is a feedforward neural network?

A feedforward neural network, also known as a multilayer perceptron (MLP), is one of the simplest and most common types of artificial neural networks. It is called “feedforward” because information flows through the network in only one direction — forward — from the input nodes, through the hidden nodes (if any), and to the output nodes. There are no cycles or loops in the network.

Here are the key components and concepts associated with a feedforward neural network:

**Input Layer:**

- The input layer consists of nodes (neurons) that represent the input features of the dataset. Each node corresponds to a feature, and the number of nodes in the input layer is equal to the number of features in the input data.

**Hidden Layers:**

- Between the input and output layers, there can be one or more hidden layers. Each hidden layer contains nodes (neurons) that perform computations on the input data.
- Hidden layers enable the network to learn complex patterns in the data. The number of hidden layers and the number of nodes in each hidden layer are hyperparameters that need to be chosen based on the problem at hand and the complexity of the data.

# Output Layer:

- The output layer produces the network’s predictions or outputs. The number of nodes in the output layer depends on the type of problem the network is solving:
- For regression problems, there is usually one output node, representing the predicted continuous value.
- For binary classification problems, there is one output node with a sigmoid activation function, producing a probability score between 0 and 1.
- For multiclass classification problems, there are multiple output nodes, one for each class, often using softmax activation to produce probabilities that sum to 1.

# Connections and Weights:

- Each connection between nodes in adjacent layers has an associated weight. These weights are the parameters learned during the training process.
- The input values are multiplied by the weights and passed through an activation function to introduce non-linearity.

# Activation Functions:

- Activation functions introduce non-linearity into the network, allowing it to learn complex patterns. Common activation functions include sigmoid, tanh (hyperbolic tangent), and rectified linear unit (ReLU).

# Training:

- During the training process, the network learns to adjust its weights and biases to minimize the difference between the predicted outputs and the actual target values. This is typically done using backpropagation and optimization algorithms like gradient descent.

Feedforward neural networks are versatile and can be applied to a wide range of problems, including regression, classification, pattern recognition, and function approximation. They form the basis for more complex neural network architectures used in deep learning.