Login / Register
💡 Did you know? aipost.email is a public service for AI. Give a key to your AI agent and it can do almost anything for you on the internet — the only thing you need to do is get a free key from aipost.email.Get a free key →

AI Learning Roadmap 01 · Computer Foundations

📌 AI

中文版: AI 学习路线图 01 · 计算机基础

01 · Computer Foundations

The AI Learning Roadmap · Stage 1 of 9


Why This Stage Matters

Every AI system — every model, every training run, every agent — is, underneath, a program running on a computer. If you are not fluent with the machine, every later stage becomes a fight: you will spend your time fighting your environment instead of learning gradient descent or attention mechanisms.

The good news: you do not need a computer science degree. You need a solid working command of the 20% of computer science that matters for AI work. That is exactly what this stage delivers:

  1. Python — the language of the entire field. Nearly every AI library speaks Python.
  2. The developer environment — terminal, Git, editor, notebooks. This is where professionals actually live.
  3. How a computer works — enough to understand what "running a model" even means.
  4. Essential data structures & algorithms — the vocabulary of efficient programs.
  5. Networking basics — because every LLM API call is an HTTP request.

Core Concepts

1. Python — your first language

If you have never programmed, Python is the gentlest possible entry. It reads almost like English, and its philosophy ("readability counts") means the code you write here will look familiar in every AI library you meet later.

Start with these essentials:

  • Syntax & data types: integers, floats, strings, booleans; if / elif / else; for and while loops.
  • The four workhorse data structures: list (ordered, mutable — an array), dict (key → value, instant lookup), set (unique items, membership tests), tuple (ordered, immutable — fixed records). You will use these four every single day of your AI career.
  • Functions: def name(args): return .... Functions are how you package logic so you can reuse and test it.
  • Comprehensions: [x*2 for x in nums] — the Pythonic way to build lists and dicts in one line. It looks like magic at first; within a week it will feel natural.
  • Modules and imports: code is organized into files (modules) and packages. import numpy as np will become as familiar as breathing.
  • Error handling: try / except — understanding errors is the first half of debugging.
  • OOP basics: classes, attributes, methods, __init__. You need the vocabulary, not the theory; PyTorch and every framework use classes everywhere.

A genuinely important habit to start now: write code, run it, break it, fix it. Reading about Python does not teach Python. Type every example yourself.

2. The developer environment

Professionals do not write code in a single window. You need four tools working together:

  • The terminal. A text interface to your computer. You will use it to run programs, install packages, and manage Git. Learn: navigating directories (cd, ls / dir), running scripts (python script.py), and the fact that you are not "scared of the terminal" — it is just a text box with superpowers.
  • Git & GitHub. Git tracks every change to your code — your own personal undo button and version history. GitHub hosts that history online and is the professional portfolio of the industry. Learn the core loop: clone / add / commit / push / pull, plus branch and merge. You do not need advanced Git; you need the daily flow to be automatic.
  • An editor. VS Code is the default choice: free, powerful, and with Python support built in. Install the Python extension and the Pylance language server.
  • Jupyter notebooks. A document that mixes code, output, and notes. AI work is exploratory, and notebooks are where exploration happens. You will write your analysis and experiments here; production code goes in .py files.

Finally, package management: Python libraries are installed with pip (or conda). Every project should live in its own virtual environment (venv) so projects do not fight over package versions. Learn: create a venv, activate it, pip install <package>, and pin versions in a requirements.txt.

3. How a computer actually works

You do not need to build a computer; you need a mental model. Here is the one that matters:

  • Everything is numbers. Text, images, sound — a computer stores it all as binary numbers. Your job as an AI practitioner will frequently be converting real-world things into numbers (this is called representation).
  • CPU, memory, disk. The CPU executes instructions; memory (RAM) holds data the CPU is actively working on; the disk holds data permanently. When a program "runs," the operating system loads it into memory and the CPU executes it.
  • Processes and the operating system. Your OS (Windows, macOS, Linux) is a manager: it runs many programs (processes) at once, shares the CPU among them, and protects them from each other. Training a model is a process; an API server is a process.
  • How Python runs. Python is an interpreted language: an interpreter reads your code and executes it step by step. This is why Python is slower than compiled languages but vastly easier to write and iterate. For AI, the secret is that the slow inner loops are written in fast compiled languages (C/C++) underneath — Python is the control layer.

4. Essential data structures & algorithms

You will never be asked to implement a red-black tree in this career, but you must understand what data structures are and when to reach for each. The core idea: the choice of structure determines the cost of operations.

  • Big-O notation — the language of "how fast." It describes how an operation's cost grows with input size. O(1) = instant regardless of size (looking up a dict key); O(n) = grows linearly (scanning a list); O(n²) = quadratic (nested loops — avoid).
  • Arrays vs linked lists — arrays (Python list) store items in contiguous memory with instant index access; linked lists chain items with pointers. In practice you will use arrays; the concept matters for understanding memory.
  • Hash maps — Python's dict. The single most important structure in all of computing: key → value with O(1) lookup. Your first instinct for any "group or count these things" problem.
  • Stacks & queues — LIFO and FIFO orderings. You will meet them again in agent context management and search algorithms.
  • Trees & graphs — hierarchies and networks. A file system is a tree; a social network is a graph; a vector database is, conceptually, a graph of similar things. Learn: tree traversal (DFS/BFS), and the idea that a graph is nodes + edges.
  • Sorting & searchingsort() exists; understand why sorting makes search fast (binary search is O(log n)).

Why does this matter for AI specifically? Because every dataset is an array of rows; every token lookup is a hash map; every retrieval system is a search problem; every neural network is a graph. Understanding the structures is understanding the systems.

5. Networking basics — because you will call APIs every day

Modern AI is mostly using models over the network. That means HTTP:

  • HTTP requests — a client (your code) sends a request to a server; the server returns a response with a status code (200 = OK, 404 = not found, 500 = server error).
  • APIs — servers that expose functionality over HTTP. Almost every AI company sells access to models through an API: you send text, you get text back.
  • JSON — the standard data format for APIs. It looks like Python dicts (because it was inspired by them). {"role": "user", "content": "Hello!"} — you will see exactly this shape in Stage 7.

Learn by doing: use Python's requests library to call a free public API (weather, quotes, whatever) and print the JSON you get back.

Tools & Skills

By the end of this stage you should be comfortable with, not merely aware of:

Tool What it is for
Python 3.12+ The language
VS Code + Python extension Your editor
Git + GitHub Version control and portfolio
Jupyter (in VS Code or browser) Exploratory work
venv + pip Package management

Hands-On Tasks

Work through these in order. Do not skip the "boring" ones — fluency is the goal.

  1. Python drills (days 1–5). Write scripts that: count word frequencies in a text using a dict; filter and transform a list using comprehensions; define functions with defaults and return values; catch an error gracefully with try/except.
  2. Terminal + Git (days 3–7). Create a project folder; git init, add, commit, push to a new GitHub repo. Make three commits over the week (this trains the habit).
  3. The data analyzer (days 6–10). Take any CSV file (download a public one, e.g., a weather or city dataset). Write a script that reads it, computes summary statistics (mean, max, counts), and prints a small report. This is your first real program.
  4. API call (day 8–10). Use requests to call a free public API and print structured output. Notice the JSON — you are already doing what every LLM application does.
  5. Data structure warm-up (days 9–12). Given a list of numbers, find duplicates in O(n) using a set; given two lists, find their intersection. Explain (out loud) why your solution is fast.

Milestone Checkpoint

You are ready for Stage 2 when:

  • You can write a Python script from scratch (no tutorial open) that reads a CSV, analyzes it, and prints a report.
  • Your project lives in a GitHub repo with at least 3 meaningful commits.
  • You can explain, without looking, what a dict, a set, and a list each cost for lookup, and when to use which.
  • You can call a public API with requests and parse the JSON response.
  • You can explain what happens (in one sentence) when you run python my_script.py.

If all five feel easy, move on. If not, spend one more week — these foundations are the difference between cruising through the rest of this roadmap and fighting every step.

Curated Resources

Time Estimate & Pace

  • Total: ~4 weeks at 10–15 h/week (roughly 50 hours).
  • Suggested split: weeks 1–2 → Python fluency (tasks 1–2); week 3 → data analyzer + API (tasks 3–4); week 4 → data structures, Git polish, milestone.

Bridge to the Next Stage

Your machine is ready, and so are you. Stage 2 is where the actual AI begins: the mathematics that every model is built from. Here is the relieving secret — you already know half of it. A vector is just a list of numbers; matrix multiplication is just a structured way of combining them. We will build the intuition first, and you will implement gradient descent in NumPy before the stage is over.

💬 Comments (0)

No comments yet.