> For the complete documentation index, see [llms.txt](https://vikram-bajaj.gitbook.io/cs-gy-6923-machine-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vikram-bajaj.gitbook.io/cs-gy-6923-machine-learning/main-4/types-of-machine-learning/supervised-learning/neural-networks.md).

# 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.

![](/files/-M5-0U8_PTj4KxWKyhl7)

$$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:

![](/files/-M5-0U8etCm5dOBbdU-6)

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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
