# Model answer: explain an artificial neuron

Subject: Deep Learning

Exam: MT2

Reader: https://deep-learning-study-room.vercel.app/#mt2/read/4/mt2-c4-s6

Canonical: https://deep-learning-study-room.vercel.app/read/dl/mt2/section/mt2-c4-s6/

## Question

**Question.** Explain the structure and working of an artificial neuron. Describe the roles of inputs, weights, bias and activation with a numerical example.

## Answer — step by step

An artificial neuron is a computational unit that applies an activation function to an affine combination of its inputs. Its trainable weights and bias determine the preactivation; its output is passed to subsequent layers.

![Follow each input through its weight, add one bias at the receiving neuron, then apply activation.](https://deep-learning-study-room.vercel.app/assets/figures/neuron.svg)

Diagram: Follow each input through its weight, add one bias at the receiving neuron, then apply activation.. Labels: INPUTS | WEIGHTED SUM | ACTIVATION | x1 | w1 | x2 | w2 | x3 | w3 | z = Σwx + b | a = f(z) | Add one bias b | Multiply → add → activate

Follow each input through its weight, add one bias at the receiving neuron, then apply activation. Tap the diagram to enlarge.

### Formula and symbols



$$
z=w_1x_1+w_2x_2+\cdots+w_nx_n+b,\qquad a=f(z)
$$



| Part | Meaning | What it does |
| --- | --- | --- |
| x₁, x₂, … | Input features | Supply the information for this calculation |
| w₁, w₂, … | Weights | Control the contribution of each matching input |
| b | Bias | Shifts the weighted sum independently of the inputs |
| z | Net input | The number before activation |
| f | Activation rule | Transforms z, often nonlinearly |
| a | Activated output | The number sent onward |

### Worked ReLU neuron example

**Question. An artificial neuron has x₁ = 2, x₂ = 1, w₁ = 0.5, w₂ = −0.2 and b = 0.1. Calculate its preactivation and ReLU output.**

### Given

Inputs = [2,1]; weights = [0.5,−0.2]; bias = 0.1; activation = ReLU.

### To find

Preactivation z and activated output a.

### Formula — which one and why

Each input contributes through its own weight. Add one bias after summing the products; ReLU then keeps a positive total.

z means before activation; a means after activation.



$$
z=w_1x_1+w_2x_2+b
$$





$$
a=\max(0,z)
$$



**Yaad rakhne ka cue:** Product, product, sum, bias, phir activation.

### Solution — step by step

**Step 1: multiply the first pair.**



$$
0.5(2)=1
$$



**Step 2: multiply the second pair.**



$$
(-0.2)(1)=-0.2
$$



**Step 3: add both contributions.**



$$
1+(-0.2)=0.8
$$



**Step 4: add the bias once.**



$$
z=0.8+0.1=0.9
$$



**Step 5: apply ReLU.**



$$
a=\max(0,0.9)=0.9
$$



**Final answer:** z = 0.9 and a = 0.9. ReLU leaves this positive preactivation unchanged.

The weights and bias are learned parameters. During training, their values are adjusted to reduce an objective. The activation function itself is usually chosen as part of the architecture. Adding a bias does not mean adding one bias after every input product; add the receiving neuron's bias once.
