# Neural Networks

These models aim to mimic the human brain, or are at least inspired by it.

The basic unit in a neural network is a **neuron**. A neuron computes a weighted sum of its inputs and then an activation is computed.

![](https://3080175707-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-0RGi-3PgC2puufMH%2F-M5-0Ri_FPdoeNpowHRz%2F-M5-0U8_PTj4KxWKyhl7%2Fneuron.png?generation=1586990817790079\&alt=media)

$$X=\begin{bmatrix}x\_0\x\_1\\.\\.\\.\\.\x\_d\end{bmatrix}$$, $$W=\begin{bmatrix}w\_0\w\_1\\.\\.\\.\\.\w\_d\end{bmatrix}$$and $$x\_0 = 1$$.

The **sigmoid activation function** $$\frac{1}{1+e^{-W^TX}}$$ gives a probability as an output. The **threshold/step activation function** outputs 1 if $$W^TX > 0$$ and 0 otherwise. The **linear activation function** simply outputs $$W^TX$$.

Some common activation functions:

![](https://3080175707-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5-0RGi-3PgC2puufMH%2F-M5-0Ri_FPdoeNpowHRz%2F-M5-0U8etCm5dOBbdU-6%2Factivation%20functions.png?generation=1586990817914844\&alt=media)

A neural network (also known as a **Multi Layer Perceptron (MLP)**) has multiple layers of neurons. The most common problem faced in neural networks is the **credit assignment problem**: it is difficult to determine which neurons are to be given credit/blame for an increase/decrease in accuracy.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vikram-bajaj.gitbook.io/cs-gy-6923-machine-learning/types-of-machine-learning/supervised-learning/neural-networks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
