## What is a Neural Network?

The artificial human brain is constructed and programmed to solve various complicated issues in a fraction of seconds, possibly due to neurons present inside the brain. While building a neural network, we try to implement the functionality of the brain neurons artificially through mathematics. The network of artificial neurons is referred to as a Neural Network.

The primary goal is to imitate the functions of the human brain. Similar to how neurons in the human brain transfer signals that assist an individual react to a given input situation, Neural Networks are built utilizing several perceptron layers that communicate an actual number or a continuous value (signal) that displays the output. The figure below shows the graphical representation of a neural network with different layers.

There are three types of layers to a neural network:

**Input layer:**This is the layer that receives user input. These are popularly called the features of the output.**Hidden layer:**This layer sits between the input and output layers. All of the necessary mathematical complex calculations are performed here. This is where the neural networks learn to solve the given problem.**Output layer:**This layer is supplied after several transformations and optimizations.

Each dense layer has nodes that are connected to other layers by edges. **Weights** signifying the value of information assigned to each node are assigned to these edges. A positive weight indicates that the node is involved in an excitatory connection, whereas a negative weight indicates that the node is involved in an inhibitory connection.

## Bayes Theorem

The Bayes theorem is a probabilities expression or a formula for finding out a conditional probability of a particular (even A) event given the occurrence of another (event B) second event using updated information from (i) its reverse conditional probability, (ii) the unconditioned (prior) probability of the first claimed event, and (iii) the unconditioned probability of the second evidential event.

The text classification is the most popular. In different Machine Learning situations, the Bayes theorem is commonly employed. The Bayes theorem has the following formula:

## What is a Bayesian Neural Network?

A Bayesian network is a statistical model used for various fields and data mining approaches. Bayesian networks illustrate interdependence between variables using probabilistic models, in which each variable takes its value from its discrete distribution with known prior probability. This networkâ€™s prior and posterior nodes include the probability distributions for hidden variables. In contrast, the posterior node contains the conditional probability distribution of hidden variables given observed values of visible variables. The advantage of Bayes net over other algorithms is that it does not require a training set with ground truth label classifications to conduct classification instead of relying on structure learning or parameter estimation.

## Artificial Neural Network (ANN) vs. Bayesian Neural Network

**ANNs** model is how a biological brain solves problems with vast clusters of biological neurons connected to form a network. ANNs are based on an extensive collection of neural units. Neural networks are highly structured networks with three layers: input, output, and hidden layers, which are any levels between the input and output layers and mostly perform linear algebraic calculations to get the result.

**Bayesian networks** are a probabilistic directed acyclic graphical model (a sort of statistical model) that uses a directed acyclic graph to describe a collection of random variables and their conditional dependencies.

## Advantages of Bayesian Neural Networks

- Bayesian networks are universally useful because their functioning algorithm is closely tied to the actual world.
- Bayesian Neural Networks calculate prediction uncertainties automatically.
- They address the overfitting issues by taking the weight distributions into account.

## Disadvantages of Bayesian Neural Networks

- They require quite a well-versed understanding of statistics and mathematics.
- They are challenging to train and take a long time to train.

## Why Use BNNs?

- BNNs do not directly use the weights for the training. Instead, they use distributions of weights for training and ultimately avoiding the overfitting problem.
- They provide a natural approach for calculating the uncertainty automatically.

## Conclusion

We now know that a neural network is just a network of artificial neurons that collaborate to solve various real-world issues. The Artificial Neural Network is the simplest type of neural network. The Bayesian Network is another sort of Neural Network that works with probability and is closely tied to real-world challenges. It is, however, sometimes tough to train and requires a good command of mathematics.