Institute of Computer Science
Courses.cs.ut.ee Institute of Computer Science University of Tartu
  1. Courses
  2. 2025/26 spring
  3. Parallelism in Deep Learning (LTAT.06.030)
ET
Log in

Parallelism in Deep Learning 2025/26 spring

  • Pealeht
  • Loengud
  • Laborid
  • Viited

Practical 1: Building Your First "Toy" Brain


Imagine you are a baker. You have Flour (X) and you want to reach a specific Sweetness (Y) .

  • The Goal: Find the perfect "Cake Recipe."
  • The Secret Recipe: Sweetness = (Multiplier x Flour) + Baseline
  • The Mission: The computer starts with random numbers for the Multiplier (W) and Baseline (B) . It must learn the correct ones by "tasting" the cake and fixing the recipe.

Task 1—The "Manual" Baker (NumPy Code) (Download)

In this step, you do all the work.

  • You calculate the sweetness by hand.
  • You use a math formula to find out who to "blame" (the Flour or the Sugar) when the cake tastes bad.
  • Why? To see how the math actually works before we let the computer take over.

Task 2—The "Automatic" Factory (PyTorch Code) (Download)

In this step, we use PyTorch (our high-tech factory).

  • We use a tool called loss.backward().
  • This tool automatically calculates the "blame" and fixes the recipe for us.
  • Why? To see how much faster and easier it is to let PyTorch handle the math.

Questions to Think About
  • If the cake is too sweet, should we decrease the Multiplier or the Baseline?
  • How does the computer know it has finally found the "Perfect Recipe"?
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment