Beginner’s Companion (Plain-English Help)
BEGINNER’S COMPANION For anyone who read a page twice and still felt lost. That is normal, and it is not a sign you are bad at this. Machine learning explanations usually start with formulas. This companion starts with
BEGINNER’S COMPANION
For anyone who read a page twice and still felt lost. That is normal, and it is not a sign you are bad at this.
Machine learning explanations usually start with formulas. This companion starts with a picture and a tiny number instead, so that when you meet the formula in the chapter, you already know what it is for. It does not replace the chapters. Think of it as a friendly guide who walks you to the door of each hard day.
How to use it (3 steps)
- Feeling lost on a day? Find that day in the table below, read its section here (one page each), then go back to the chapter.
- Read the “In one sentence” line out loud. If you can say it in your own words, you are ready.
- Redo the tiny numbers with a calculator. Ten minutes with real numbers beats an hour of re-reading.
Where you are Read this Page
Day 4 onward, new words The whole story in one page, then the jargon p. 461 everywhere decoder
Day 9 · Neural networks A neuron is a tiny voting machine p. 463
Day 10 · Backpropagation Backprop = sharing out the blame p. 464
Day 11 · PyTorch The five-line training loop, line by line p. 465
Day 12 · CNNs A small stamp sliding over a picture p. 466
Day 13 · Attention Words looking each other up p. 467
Day 15 · GenAI bridges RAG, tools, agents and MCP p. 468
Planning or stuck Gentle study plan, “what to do when stuck”, p. 469 self-check quiz
A promise worth remembering Every model in this book, from a straight line to a Transformer, is trained by the same loop: guess, measure how wrong, work out who is to blame, adjust a little, repeat. Only the “guessing machine” changes.
DAYS 4–8 · THE BIG PICTURE
In one sentence: machine learning is tuning the knobs of a guessing machine until its guesses stop being embarrassing.
Imagine learning your grandmother’s recipe by taste-testing. You cannot read her mind, so you cook, ask a taster for a score, and adjust. Replace the cook with a computer and you have machine learning:
Cooking story Machine-learning word Plain meaning
Past dishes and their scores Data (features and labels) Examples with the right answer attached
A recipe with adjustable Model with parameters The guessing machine and its knobs (weights) knobs
Cook a dish, predict the score Forward pass → prediction Use current knobs to make a guess
“You guessed 6, real score Loss One number: how wrong was the was 9” guess
Which knob caused the Gradient (backprop finds it) For each knob: turn up or down, problem? how strongly
Turn each knob a tiny bit Gradient descent step Move knobs so the loss gets smaller
Size of each turn Learning rate Too big overshoots, too small crawls
Fresh tasters, never seen Test set The honest exam for the finished before model
Perfect on old tasters, bad on Overfitting Memorised the examples instead new of learning the idea
The training loop (you will see this in every chapter, in many disguises):
repeat many times (each full pass over the data is one "epoch"):
guess = model(inputs) # 1. forward pass: make guesses
loss = how_wrong(guess, answers) # 2. loss: one number for "how bad"
blame = work_out_blame(loss) # 3. backpropagation: blame per knob
knobs = knobs - small_step * blame # 4. gradient descent: nudge the knobsThree questions that unlock any chapter 1. What goes in? 2. What comes out? 3. What is being adjusted while it learns? If you can answer these three, you understand the chapter’s main idea, even before the maths.
JARGON DECODER
Word In plain English Everyday picture
Feature One input measurement A column: age, hours studied, pixel brightness
Label / target The right answer The score the taster gave
Weight How much an input matters A volume knob for one input
Bias A starting nudge Adding a pinch of salt before anything else
Epoch / batch One full pass / a small chunk of it Reading a whole book / one chapter at a time
Train / validation / Practise / mock exam / real exam Never study from the real exam test
Vector A list of numbers [2, 1] = 2 hours studied, 1 hour slept
Shape How many rows and columns (3, 2) = 3 rows, 2 columns
Activation A bend that stops stacked layers A light switch that eases on collapsing into one straight line
Softmax Turns scores into percentages that add [2.0, 1.0, 0.1] → [66%, 24%, 10%] to 100%
Embedding Meaning stored as a list of numbers Map coordinates: close = similar
Token A piece of text the model reads Often a word or part of a word
How to read a formula without panic
A formula is a sentence written in shorthand. Read it left to right, say each piece in words, and it stops being scary:
Formula Say it in words
w = w − lr × gradient New knob = old knob minus (step size × blame). Used in every new training loop.
z = w·x + b Weighted sum: multiply each input by its weight, add them up, add the nudge.
a = σ(z) Squash the weighted sum into a usable range (for sigmoid, between 0 and 1).
loss = (y − t)² How far the guess is from the target, squared so big misses hurt more. softmax(QK T ÷ √d) V Score the matches, keep scores modest, turn into percentages, blend the values.
DAY 9 · NEURAL NETWORKS
In one sentence: a neuron multiplies each input by how much it matters, adds them up, and squashes the total into a usable answer.
Predict whether a student passes. Two inputs: hours studied = 2 and hours slept = 1. The neuron has learned that studying matters more than sleep (weights 0.5 and 0.3) and starts with a small pessimism (bias −0.5).
Step Calculation Result
- Weighted sum 0.5 × 2 + 0.3 × 1 + (−0.5) z = 0.8 2. Squash (sigmoid) 1 ÷ (1 + e −0.8 ) 0.69 → “69% likely to pass”
3a. If the student passed loss = −ln(0.69) 0.37 (small: we were fairly right)
3b. If the student failed loss = −ln(1 − 0.69) 1.17 (big: we were confidently wrong)
Why the loss uses a logarithm It punishes confident wrong answers hard and cautious wrong answers gently. That pressure is what pushes the network to be honest about uncertainty.
Why a bend (activation) is needed. Double a number, add 1, then double again: you get *4x + 2, still a straight line. No matter how many straight-line layers you stack, you only ever get one straight line. An activation such as ReLU* (“negative becomes 0, positive stays”) adds a bend, and bends let the network draw curves. The XOR example on p. 184 shows two ReLU neurons solving what no single line can.
A layer is a team. In a hidden layer, every neuron looks for a different pattern in the same inputs. The next layer reads the team’s findings and combines them. “Deep” just means many teams in a row.
The shape rule that prevents most errors
Multiplying (rows, in) @ (in, out) gives (rows, out). The two inner numbers must match. A network reading a 28×28 image (784 numbers) with 128 hidden neurons and 10 outputs has 784×128 + 128 = 100,480 and 128×10 + 10 = 1,290 parameters: 101,770 knobs in total.
Most common Day 9 stumbles
- “Shapes cannot be multiplied”: print
.shapeof every array and check the inner numbers. - Using softmax in the middle of the network: it belongs at the end, to turn scores into percentages.
- Starting all weights at zero: every neuron then learns the same thing. Use small random numbers.
Go back to the chapter: Day 9 starts on p. 183 ; the one-neuron-by-hand example is on p. 189 .
DAY 10 · BACKPROPAGATION
In one sentence: after a wrong guess, backprop walks backward through the network and tells every weight how much it contributed to the mistake.
A team report gets a poor grade. Fair blame depends on *how much each person’s part mattered: the last person is blamed first, then blame passes back to whoever fed them. This “pass back and multiply” is the chain rule*.
The smallest possible network: h = w1 × x then y = w2 × h. Start with x = 2, w1 = 1, w2 = 3, and the right answer is 4. Loss = (y − 4)².
Step Number
Forward h = 1 × 2 2
Forward y = 3 × 2 6 (too high: the answer is 4)
Forward loss = (6 − 4)² 4
Backward blame at y: 2 × (6 − 4) 4
Backward blame on w2 = 4 × h (its input is 2) 8
Backward blame passed to h = 4 × w2 (which is 3) 12
Backward blame on w1 = 12 × x (its input is 2) 24
The pattern: blame on a weight = (blame arriving from the right) × (the value that weight was multiplied with).
Now take a step. New weight = old weight − learning rate × blame.
Learning rate New w1, w2 New y New loss
0.01 (gentle) w1 = 1 − 0.24 = 0.76, w2 = 3 − 0.08 = 2.92 4.44 0.19 (was 4)
0.05 (too big) w1 = 1 − 1.2 = −0.2, w2 = 3 − 0.4 = 2.6 −1.04 25.4 (much worse)
Picture it: walking down a valley in fog. A gentle step gets you lower; a giant step jumps to the opposite hillside, higher than before. If the loss explodes, divide the learning rate by 10 first.
When the loss will not go down, check in this order
- Print the loss every epoch. Is it falling, or is it NaN? Lower the learning rate by 10×.
- Train on just 10 examples. Loss should fall near 0. If not, the bug is in the code, not the data.
- Print shapes. In PyTorch, make sure gradients are cleared every step (next section).
Back to the chapter: one neuron p. 193 , a hidden layer with every number p. 196 , chain rule p. 207 .
DAY 11 · PYTORCH
In one sentence: PyTorch is NumPy that remembers what you did to each number, so it can do the backward pass for you.
Everything you did by hand on Days 9–10 is automated. You only need to recognise the five lines of the loop and know what each one means:
for x, y in data_loader: # take one small batch of examples
pred = model(x) # 1. forward pass: make a guess
loss = loss_fn(pred, y) # 2. how wrong was it?
optimizer.zero_grad() # 3. wipe the blame left over from last step
loss.backward() # 4. backprop: blame for every weight
optimizer.step() # 5. nudge every weight a little*Line Plain meaning What goes wrong if you forget it*
model(x) Make guesses with the current Nothing to measure knobs
loss_fn(pred, y) Turn all the mistakes into one Nothing to improve number
zero_grad() Clear the old blame Blame adds up across steps and training behaves strangely
backward() Work out the blame Weights never change
step() Apply the nudge Blame is computed but never used
Tensor shapes you will meet. A table of data is (batch, features). A batch of pictures is (batch, channels, height, width), for example (64, 1, 28, 28) for 64 black-and-white digits. When something breaks, print the shape first.
Training mode and exam mode. Call model.train() while learning and model.eval() when measuring, with torch.no_grad() so no blame is recorded. Layers such as dropout behave differently in the two modes.
Three errors almost everyone meets once
- mat1 and mat2 shapes cannot be multiplied: the inner sizes of two layers do not match. Print shapes.
- Expected all tensors to be on the same device: model and data must both be on the CPU or both on the GPU.
- Test accuracy is much worse than training accuracy: that is overfitting (Day 5), not a bug.
Back to the chapter: Day 11 starts on p. 212 .
DAY 12 · MNIST AND CNNS
In one sentence: a CNN reuses one small pattern detector across the whole image, which needs far fewer knobs than treating every pixel separately.
A plain network (MLP) flattens a 28×28 picture into 784 unrelated numbers and loses the fact that nearby pixels belong together. A convolution slides a small 3×3 stamp (a filter) over the picture, asking at every spot: “does this look like an edge, a corner, a curve?” Pooling then shrinks the picture by keeping the strongest signal in each small window. Early layers find edges, later layers combine them into shapes, the last layers decide which digit it is.
Track the shape, layer by layer
Output size = (size − kernel + 2 × padding) ÷ stride + 1. For a 28-wide image with a 3×3 kernel:
Layer Calculation Size after
Conv 3×3, padding 1, stride 1 (28 − 3 + 2) ÷ 1 + 1 28 (padding keeps the size)
Conv 3×3, padding 0, stride 1 (28 − 3 + 0) ÷ 1 + 1 26 (edges are lost)
Max-pool 2×2 28 ÷ 2 14 (halved)
Conv 1→16 channels, 3×3 16 × (1×3×3) + 16 160 parameters in total
Why this saves so many knobs One 3×3 stamp has just 9 weights (plus a bias) but is used at every position. A fully connected layer from 784 pixels to 128 neurons needs 100,480. That sharing is the whole trick.
Two safety nets for overfitting. Dropout randomly switches off some neurons while training, so the network cannot depend on any single one. Early stopping halts training when the validation loss stops improving, before the model starts memorising.
Back to the chapter: shape-tracking table p. 250 , MLP vs CNN project p. 416 .
DAY 13 · ATTENTION AND TRANSFORMERS
In one sentence: attention lets every word build its meaning by taking a weighted blend of information from the other words.
In “The animal didn’t cross the street because it was too tired”, a reader links it to animal. Attention does the same with numbers. Each word produces three things:
Part The question it answers Library picture
Query (Q) What am I looking for? Your question at the front desk
Key (K) What do I contain, as a label? The label on each book’s spine
Value (V) What do I hand over if chosen? The content inside the book
Four steps: (1) score every Q against every K (dot product: bigger = better match); (2) divide by √d so scores stay modest; (3) softmax turns each row into percentages; (4) output = percentages × values. Tiny example with two words A and B and d = 2:
Step Result
Q = K = [[1, 0], [0, 1]], V = [[10, 0], [0, 20]] A is “about x”, B is “about y” Scores = Q·K T ÷ √2 [[0.71, 0], [0, 0.71]]
Softmax of each row A: [0.67, 0.33] B: [0.33, 0.67]
Output for A = 0.67×[10, 0] + 0.33×[0, 20] [6.7, 6.6]
Output for B = 0.33×[10, 0] + 0.67×[0, 20] [3.3, 13.4]
Read it as: word A mostly keeps its own information (67%) but borrows a third from B. Real models do this with hundreds of numbers per word and many “heads” looking for different relationships at once.
*A Transformer block, in everyday words Attention (look around) → feed-forward layer (think about what you saw). Around each step sits a residual connection (keep a copy of the original so nothing is lost) and layer norm* (keep the numbers tidy). Stack the block many times and you have the heart of an LLM.
How a chat model writes. It predicts the next token, adds it to the text, and repeats. A causal mask stops each position from peeking at words that come later, because at writing time they do not exist yet.
Three look-alikes to keep apart
- Token ≠ word: a token can be a word, part of a word, or punctuation.
- Embedding ≠ token: the token is an ID number; the embedding is its learned list of numbers.
- Attention ≠ the whole Transformer: it is one important part inside each block.
Back to the chapter: weighted-average idea p. 261 , two-token example p. 262 , three-token example p. 265 .
DAY 15 · GENAI BRIDGES
In one sentence: a language model only writes text; everything else (documents, tools, memory) is code you build around it.
RAG = an open-book exam
A model does not know your private files and sometimes invents answers. Retrieval-Augmented Generation lets it “look things up” first:
# Step Plain meaning
1 Chunk Cut documents into small passages
2 Embed Turn each passage into a list of numbers that captures its meaning
3 Store Keep those lists in a vector database
4 Search Embed the question the same way, then find the top-k closest passages (cosine similarity: 1 = same direction, 0 = unrelated)
5 Answer Paste those passages and the question into the prompt; the model answers *using what you gave it*
Tiny check: four chunks score [0.2, 0.9, 0.4, 0.85] and k = 2, so the model sees chunks 1 and 3 only (counting from 0). That is why good chunking and search decide answer quality ( p. 310 ).
RAG vs fine-tuning: RAG changes what the model reads. Fine-tuning changes the model’s weights through extra training.
Tools, agents and MCP
Idea Plain meaning Everyday picture
Tool call The model writes a structured request; your code The model dictates a note; you runs it and returns the result do the errand
Agent A loop: ask for a tool, read the result, repeat until An assistant who keeps done. Always set a step limit checking back
MCP A standard way for AI apps to discover and call A USB-C port for tools your tools
Safety basics, even for a first project
- Prompt injection: a retrieved document may contain instructions such as “ignore the rules”. Treat retrieved text as data, never as orders.
- Keep API keys out of your code and out of GitHub. Cap input length and spending.
- Climb the project ladder in order, one stage at a time ( p. 316 , p. 433 ).
STUDY PLAN AND SELF-CHECK
Fifteen days is the intensive route. If you study 1–2 hours a day, this slower plan is more realistic and just as complete.
Week Days You are done when you can…
1 1–3 Write a loop and a function, explain a shape like (3, 2), and load a table with Pandas
2 4–6 Explain loss and gradient descent aloud; split data into train / validation / test; read a confusion matrix
3 7–8 Say what an embedding is; finish the Telco project on the smallest dataset first
4 9–10 (slowly) Reproduce the blame calculation for the tiny network on paper
5 11–12 Write the five-line PyTorch loop from memory; track CNN shapes by hand
6 13 Redo the two-word attention example and explain Q, K and V in your own words
7 14–15 Finish a capstone; explain RAG as an open-book exam to a friend
First-pass reading tip The book labels Day 15 bridges and the Appendix supplements as “optional advanced”. On your first pass you can skim them and return after the core feels solid. When an equation blocks you, read the plain-English line next to it, keep going, and come back.
When you are stuck, try this ladder
- Say what confuses you in one sentence. Often that sentence points at the missing idea.
- Shrink the problem: 5 rows of data, 2 neurons, 3 words. Do it by hand.
- Print values and shapes after each line.
- Reread the day’s Big Picture and the matching page in this companion.
- Search the exact error message, then compare with the book’s code line by line.
- Explain the problem to a friend (or write it down). Most bugs appear while explaining.
Self-check: can you answer these in one sentence?
Question Answer
What is the loss? One number saying how wrong the guesses are
What does a gradient tell a weight? Whether to go up or down, and how strongly
What if the learning rate is too big? Steps overshoot and the loss can get worse or explode
What is overfitting? Great on training data, poor on new data: it memorised
Why do networks need activations? Without bends, stacked layers act like one straight line
What does backprop compute? The blame (gradient) for every weight, working backward
Why call zero_grad()? Otherwise old blame adds to new blame
A 28-wide image, 3×3 kernel, padding 1: new 28 (padding keeps it) width?
What are Q, K and V? What I look for / my label / what I hand over
Why softmax in attention? Turns match scores into percentages that add to 100%
What is RAG? Fetch relevant text first, then let the model answer using it
What is an agent? A loop where the model picks tools until the task is done AXLY · axly.in
Ml + Deep Learning
| FUNDAMENTALS |
|---|
A 15-Day Practical Learning Course
| Concepts • Python Code • Assignments • Solutions • Projects |
|---|
| A beginner-friendly self-study path through machine learning and deep learning. Start with |
|---|
| Python and math prerequisites, then learn NumPy and Pandas, classical machine learning, |
| neural networks from scratch, PyTorch, CNNs, and Transformers, and finish with the ideas |
|---|
| behind modern GenAI: embeddings, vector search, RAG, agents, tools and MCP. |
WHAT IS INSIDE
- 15-day course, from Prerequisites on Day 1 to GenAI Bridges and the study toolkit on Day 15
- Short explanations, Python code examples, step-by-step worked problems with solutions, checkpoints and quick recaps
- Part IV — Assignment & Project Guide: tasks, hints, README templates, GitHub submission steps and a solutions appendix
- Part V — Project Walkthroughs: four step-by-step builds — Telco churn, MNIST (MLP vs CNN), a Capstone rebuild, and a ten-stage GenAI Project Ladder (embeddings, vector search, RAG, tools, agents, MCP, API)
- Glossary, supplements, references and an index
Author Slayer Copyright holder Medicharla Ravi Kiran Publishing brand Axly Website https://axly.in Connect Telegram · LinkedIn · GitHub · Email
© 2026 Medicharla Ravi Kiran. All rights reserved. Published under the Axly publishing brand.