Velamuvi AIAcademy

Lesson 10 of 12 · Reading Maths

Greek Letters You Will Meet

A friendly guide to the Greek letters and symbols used in AI and machine learning: theta, alpha, lambda, mu, sigma, epsilon, hats, bars and subscripts, with Python translations.

  • 8 min read
  • Beginner
  • Reviewed
In this lesson you will learn
  • Why maths uses Greek letters
  • The Greek letters you will meet most in AI, and their usual meanings
  • What hats, bars, subscripts and superscripts mean
  • How to translate a formula with Greek letters into Python

Why Greek letters?

Maths needs many names for many kinds of quantity, and the Latin alphabet runs out quickly. Greek letters give extra names. Over time, many of them gained traditional meanings: when an AI paper writes θ, it almost always means "the model's parameters".

You do not need to memorise the whole alphabet. A dozen letters cover nearly everything you will read.

The letters you will meet

LetterNameUsual meaning in AI
θthetamodel parameters
α, ηalpha, etalearning rate
βbetaa coefficient, or a setting of the Adam optimiser
γgammadiscount factor in reinforcement learning
λlambdaregularisation strength
μmumean
σsigmastandard deviation, or the sigmoid function
ΣSigmasum
ΠPiproduct
πpi3.14159..., or a policy in reinforcement learning
εepsilona tiny number
Δ, δdeltachange, small difference
∇nabla (not Greek)gradient: the direction of steepest increase

Marks on top and underneath

Letters often carry small marks that change their meaning:

Translating a formula into Python

Here is the prediction formula of a linear model, written the way a paper would:

ŷ = θ₀ + θ₁x

Read it as: "the prediction equals theta-zero plus theta-one times x". θ₀ is the intercept and θ₁ is the slope. You already know this line from the Linear Functions lesson, just with new names.

Try it yourselfPython
theta_0 = 2.0     # θ₀, the intercept
theta_1 = 0.5     # θ₁, the slope

xs = [0, 4, 10]
for x in xs:
    y_hat = theta_0 + theta_1 * x       # ŷ = θ₀ + θ₁x
    print(f"x = {x}: y_hat = {y_hat}")

And here is one step of gradient descent, the update rule at the heart of training. You will learn where it comes from in the calculus course. For now, just practise reading it:

θ  ←  θ - α · ∇L(θ)

"Update theta: take theta, minus alpha times the gradient of the loss." In plain words: move the parameters a small step (α) in the direction that reduces the error.

Try it yourselfPython
theta = 5.0          # current parameter value
alpha = 0.1          # learning rate α
gradient = 4.0       # ∇L(θ): how fast the loss grows as θ grows

theta = theta - alpha * gradient
print("Updated theta:", theta)

The arrow ← means "becomes", exactly like = in Python.

Python and Greek letters

Python actually allows Greek letters in variable names, but most teams avoid them because they are hard to type. The standard style is to spell them out:

Try it yourselfPython
mu = 50.0
sigma = 10.0
epsilon = 1e-8

x = 65.0
z = (x - mu) / (sigma + epsilon)      # how many standard deviations above the mean
print(round(z, 3))

Common mistakes

Practice exercise

Translate a formula full of Greek letters and marks into Python.

Your solutionPython
# A model predicts with:  ŷ = θ₀ + θ₁x
# with θ₀ = 1 and θ₁ = 3.
# The true values y are given below for each x.
# 1. For each x, work out y_hat and the error (y - y_hat).
# 2. Then work out the mean of the errors, written ē (e-bar).
xs = [1, 2, 3]
ys = [5, 6, 11]

# Output must be exactly:
# x=1 y=5 y_hat=4 error=1
# x=2 y=6 y_hat=7 error=-1
# x=3 y=11 y_hat=10 error=1
# e_bar = 0.333
Knowledge check

In an AI paper, what does ŷ usually mean?

Summary

  • Greek letters give maths extra names, and many have traditional meanings in AI.
  • θ is the parameters, α or η the learning rate, λ regularisation, μ the mean, σ the spread (or sigmoid) and ε a tiny number.
  • A hat (ŷ) means a prediction. A bar (x̄) means a mean. A superscript in brackets is a label, not a power.
  • Read formulas out loud, then translate them line by line into Python.

Next: sets and intervals, the language for describing groups of values.

Finished reading? Tick it off to track your progress.