How I Actually Learned AI and Machine Learning: An Honest 18-Month Roadmap
If you search "how to learn AI" on YouTube or social media, you will see thumbnail after thumbnail promising you can become a job-ready machine learning engineer in 30 days — or maybe 3 months if you take your time. In early 2024, I fell for that exact pitch. I had a basic software background, and I convinced myself that if I just watched enough video lectures, I’d be building state-of-the-art neural networks by summer.
Eighteen months later, I am finally working as a machine learning engineer, writing custom PyTorch models, tuning data pipelines, and shipping AI features to production. But my actual learning path looked nothing like the smooth, linear diagrams you see online. It was messy, frustrating, and full of false starts. I stalled out completely for nearly a month because mathematical notation terrified me, I spent weeks consuming video courses that taught me zero real-world skills, and I made almost every embarrassing beginner mistake in the book.
This is the honest, unvarnished story of how I went from knowing zero machine learning to feeling genuinely competent — what actually worked, what wasted my time, and why real competence takes 18 months, not 90 days.
Anyone promising to turn you into an AI practitioner in 4 weeks is selling you a fantasy. Real machine learning isn't just importing a library and calling model.fit(). It requires developing an intuition for data distributions, matrix transformations, loss surfaces, and debugging cryptic hardware and tensor shape errors. That intuition only comes from hundreds of hours of hands-on coding and failure.
Phase 1: Week 3 of Andrew Ng and the Math Panic
Like almost everyone starting out in AI, my first stop was Andrew Ng’s famous Machine Learning course on Coursera. The first two weeks felt great. Linear regression with a single variable was intuitive, the high-level explanations were crystal clear, and I felt like I was making rapid progress.
Then came Week 3: logistic regression cost functions, partial derivatives, vectorization equations, and matrix operations written in mathematical notation filled with subscripts, superscripts, and Greek letters.
I remember staring at an equation for the gradient of the log loss function and feeling completely lost:
I panicked. I hadn't taken a formal calculus class in four years, and linear algebra was a distant blur. I spent three days trying to decipher why the transpose of matrix X was being multiplied by the prediction error vector, getting more confused with every page of notes I scribbled. The internal panic set in: Maybe I'm just not smart enough for this field. Maybe ML is strictly for computer science PhDs.
I closed the browser tab, put my notebook in a drawer, and didn't touch a single machine learning resource for nearly four weeks.
Phase 2: The Kaggle Breakthrough That Saved My Journey
My turning point happened almost by accident. A friend who worked as a junior data analyst urged me to stop watching video lectures passively and just enter a Kaggle competition — specifically the classic Titanic: Machine Learning from Disaster beginner dataset.
I was terrified. I thought, "How can I build a model when I haven't mastered partial derivatives by hand?" But I downloaded the CSV files anyway and opened a blank Jupyter notebook.
For the first two days, I had no idea what I was doing. I copied code snippets from public Kaggle notebooks, ran them, and watched my submission land at rank 4,890 out of 15,000. But then I started tweaking things myself. I noticed that over 20% of the passenger ages were missing in the raw dataset.
Instead of dropping those rows or blindly filling them with the overall median age like the starter tutorial did, I wrote a small Pandas script to impute missing ages based on passenger titles ("Mr.", "Mrs.", "Master", "Miss"). When I re-ran my Scikit-Learn Random Forest model, my validation accuracy jumped by nearly 2.4%.
That was the exact moment everything clicked for me. I realized I didn't need to derive backpropagation equations by hand on a whiteboard before I could build something useful. The hands-on feedback loop of Kaggle forced me to learn Pandas, Scikit-Learn, and feature engineering because I was actively solving a concrete puzzle, not passively watching someone else solve it.
Phase 3: Deep Learning, PyTorch, and the Nightmare of Shape Mismatches
After three months of classical machine learning on tabular data, I felt confident enough to tackle deep learning. Everyone on tech Twitter said "PyTorch is Pythonic and intuitive!" What they forgot to mention is that PyTorch will happily throw 50-line C++ stack traces at you the second your tensor dimensions don't align perfectly.
My first simulated "trial by fire" came when I tried building a simple Multi-Layer Perceptron (MLP) to classify MNIST handwritten digits from scratch, without high-level wrappers like Keras or PyTorch Lightning.
I wrote out the layer architecture, loaded the images with PyTorch DataLoader, and hit run. Immediately, my terminal exploded with an error:
Traceback (most recent call last):
File "mnist_train.py", line 38, in <module>
output = model(images)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "mnist_train.py", line 19, in forward
out = self.fc1(x) # <-- Crash: mat1 [32, 1, 28, 28] vs mat2 [784, 128]
I spent five hours debugging that single line. I printed x.shape everywhere, pulled my hair out, and read PyTorch forum threads until 2 AM before I finally realized: an image batch comes in as a 4D tensor [batch_size, channels, height, width], but a standard PyTorch nn.Linear layer expects a 2D matrix [batch_size, features]. I had forgotten to flatten the spatial dimensions!
Here is the exact PyTorch pattern I wrote that night, along with the inline comments I added to remind my future self how tensors actually flow through a network:
import torch
import torch.nn as nn
import torch.optim as optim
class RealisticDigitClassifier(nn.Module):
def __init__(self, input_features=784, hidden_units=128, num_classes=10):
super().__init__()
# Linear layer expects 2D input: (batch_size, input_features)
self.fc1 = nn.Linear(input_features, hidden_units)
self.relu = nn.ReLU()
self.fc2 = nn.Linear(hidden_units, num_classes)
def forward(self, x):
# LESSON LEARNED THE HARD WAY:
# Input 'x' comes from DataLoader as shape [32, 1, 28, 28] (batch, channel, H, W).
# We MUST flatten dimensions 1, 2, and 3 into a single feature vector of size 784!
if x.dim() > 2:
x = x.view(x.size(0), -1) # Reshapes [32, 1, 28, 28] -> [32, 784]
x = self.fc1(x)
x = self.relu(x)
logits = self.fc2(x)
return logits
# Quick sanity check simulation I always run now before full training loops:
if __name__ == "__main__":
dummy_batch = torch.randn(32, 1, 28, 28) # Simulated batch of 32 grayscale images
model = RealisticDigitClassifier()
# Verify shape before passing to optimizer
output = model(dummy_batch)
print(f"Success! Output batch shape: {output.shape}") # Expect [32, 10]
# Loss check: CrossEntropyLoss expects unnormalized logits + class indices
criterion = nn.CrossEntropyLoss()
dummy_labels = torch.randint(0, 10, (32,))
loss = criterion(output, dummy_labels)
print(f"Initial loss check: {loss.item():.4f}") # Should be around ln(10) ~ 2.302
That debugging nightmare taught me a golden rule I still follow every day: Never trust your assumptions about tensor shapes. Print them, assert them, and test them with dummy inputs before launching any full training loop.
What Wasted My Time vs. What Actually Worked
Looking back over 18 months, at least 40% of my time was spent on low-value activities that gave me the illusion of learning without building real-world competence. Here is the breakdown of what failed versus what paid off:
| Approach | The Reality of What Happened | Verdict |
|---|---|---|
| Udemy Video Binging | Watching 50+ hours of video lectures at 1.5x speed without coding along. Created fake confidence; forgot 90% within a week. | Wasted 2 Months |
| Front-Loading Heavy Math Books | Reading 700-page textbooks cover-to-cover before writing code. Without practical context, abstract linear algebra didn't stick. | Wasted 1.5 Months |
| Fast.ai (Jeremy Howard) | Top-down practical approach. Showed how to train models first, then explained underlying math and code layer by layer. | Game Changer |
| Karpathy's "Zero to Hero" | Building micrograd (autograd engine) and GPT from scratch in pure Python. Demystified backpropagation and attention mechanisms. | Essential Viewing |
| Building Scratch Projects & Writing | Building 4 standalone projects (e.g., custom document search RAG pipeline) and publishing detailed technical writeups on GitHub. | Got Me Hired |
The Realistic 18-Month Timeline
If you are planning your learning journey today, here is what a realistic, sustainable timeline actually looks like — based on someone who went through it without a computer science degree:
- Months 1–3: Python Data Basics & The Kaggle Scratchpad. Focus on NumPy array operations, Pandas DataFrames, and basic Scikit-Learn models (Decision Trees, Logistic Regression, Random Forests). Learn data cleaning, handling missing values, and train/test splits. Learn math concepts only as they appear in real code.
- Months 4–6: Classical Machine Learning & Validation. Deep dive into Gradient Boosted Decision Trees (XGBoost, LightGBM), feature engineering, hyperparameter tuning with Optuna, and strict cross-validation strategies to avoid data leakage.
- Months 7–10: Deep Learning Foundations with PyTorch. Learn to write custom neural networks from scratch in PyTorch. Build Convolutional Networks (CNNs) for vision and Recurrent / Transformer architectures for sequence data. Master GPU memory management and learning rate schedulers.
- Months 11–14: Modern NLP & Large Language Models. Master HuggingFace Transformers, fine-tuning pre-trained models (BERT, LLaMA) using LoRA/PEFT parameter-efficient techniques, and building Retrieval-Augmented Generation (RAG) applications with vector databases like ChromaDB.
- Months 15–18: MLOps, Deployment, and Portfolio. Containerize models with Docker, serve real-time predictions via FastAPI endpoints, log experiment metrics with Weights & Biases, and publish clean GitHub repositories with documented READMEs.
My Unfiltered Advice for Anyone Starting Today
If I could go back in time to early 2024 and talk to myself while I was panicking over Andrew Ng's cost function equation, here is what I would say:
Stop hoarding learning materials. Having 40 book PDFs and 12 bookmarked courses on your browser bar isn't progress. Pick one project-based resource — like fast.ai or Andrej Karpathy's video series — and stick with it until completion.
Embrace error tracebacks as progress. When PyTorch or CUDA throws a cryptic error message, don't get demoralized. More than 70% of a professional ML engineer's daily work consists of reading stack traces, inspecting tensor shapes, and debugging data pipelines.
Build things you personally care about. Don't just re-run the Iris dataset notebook for the hundredth time. Build an automated image classifier for your photo collection, or a semantic search engine for your favorite podcast transcripts.
Give yourself permission to take 18 months. Mastery takes time. The people selling you 30-day shortcuts are taking your money; the people who thrive in this industry are the ones who show up every day, write buggy code, fix it, and keep learning.
Pratyush
Pratyush is an AI researcher learning machine learning, computer vision, and deep learning architectures. He focuses on practical, hands-on ML implementation and building accessible educational resources. His journey from struggling with mathematical notation to working as a professional ML engineer informs the practical, no-nonsense approach of this guide.
Continue Your Learning Journey
Based on your interest in this learning roadmap, here are complementary guides to deepen your understanding:
Machine Learning Foundations
Master supervised vs unsupervised learning with practical scikit-learn examples
Neural Networks Deep Dive
Build networks from scratch and understand backpropagation, optimizers, and architecture
The Mathematics of ML
Linear algebra, calculus, and statistics made intuitive for practitioners
Continue Through the Maze
Supervised vs Unsupervised ML
Classification labels vs automated cluster recognition models.
MathematicsThe Math Behind ML
Linear algebra, partial derivatives, and gradient descent.
AI HistoryThe Complete History of AI
From ancient myths and Turing to GPT-4 and beyond.
AI EthicsEthical AI Frameworks
Digital literacy, bias, and safe AI in student curriculums.