LLM + RoboticsModule 02 · Practice platform & foundations

TensorTonic: hands-on ML practice for LLMs and robotics

An ML coding gym with 1,300+ implement-from-scratch problems. This module shows what it offers and which parts to use for robotics, in what order.

Source: tensortonic.com, fetched 21 Oct 2026 · snapshot in sources/02-tensortonic.md

In this module
  1. Summary
  2. Why this matters for robotics
  3. Deep dive: a robotics practice track
  4. Deep dive: homogeneous transforms (worked example)
  5. Deep dive: which ML math matters for robots
  6. Deep dive: the RL ladder
  7. What it doesn't cover
  8. Playbook
  9. Self-check
  10. Glossary & further reading

1. Summary

TL;DR

TensorTonic is like LeetCode for machine learning. You implement algorithms from scratch in Python, NumPy, PyTorch, CUDA or Triton, run them against tests in the browser, and get interactive visuals of the maths. It has no robotics section, but its 3D geometry, computer vision, reinforcement learning, ML maths and inference/GPU content covers most of the learning half of modern robotics. The free tier is enough to start.

2. Why this matters for robotics

Track: LLM + Robotics. TensorTonic is a general ML platform. Its transformer, LLM-internals, inference and CUDA tracks serve the LLM side. Its geometry, vision and RL problems serve robotics (the path below). It won't teach you motors, kinematics or control.

Modern robotics stacks have two halves:

Classical halfLearning half
Rigid-body geometry, kinematics, dynamics, control (PID, MPC), state estimation (Kalman filters), SLAM, motion planningPerception (detection, segmentation), reinforcement learning, imitation learning, transformer-based robot policies (VLAs), on-device inference

TensorTonic covers the shared maths and most of the learning half. Implementing things from scratch is the right habit for robotics. When a robot behaves strangely, you need to know what's inside the box.

3. Deep dive: a robotics practice track

A suggested order through TensorTonic content, picked for robotics. Problem names link to the site.

Stage A · Maths you'll use every day (2–3 weeks)

Stage B · 3D geometry & perception (2–3 weeks)

Stage C · Reinforcement learning (3–4 weeks)

Stage D · Transformers → robot foundation models (3–4 weeks)

Stage E · Running models on the robot (ongoing)

4. Deep dive: homogeneous transforms (worked example)

This is TensorTonic's most directly robotic problem, and the idea underpins everything from arm kinematics to camera calibration.

The problem: a robot has many coordinate frames: world, base, each joint, gripper, camera. A point seen by the camera must be expressed in the gripper's frame before the arm can reach it. Each frame-to-frame relation is a rotation R (3×3) plus a translation t (3×1).

The trick: append a 1 to every point, p = (x, y, z, 1). Then rotation and translation fit in a single 4×4 matrix:

T = | R  t |      p' = T · p
    | 0  1 |

Why bother? Because chains of frames become plain matrix products. T_world←camera = T_world←base · T_base←gripper · T_gripper←camera. That chain is forward kinematics. Inverting is cheap too: T⁻¹ = [Rᵀ, −Rᵀt; 0, 1].

Interactive: a two-link arm as chained transforms (2D)

Each link is a rotation by its joint angle, then a translation along the link. The gripper's position is the product of both transforms applied to the origin.

Gripper x
–
Gripper y
–
Gripper angle
–
NumPy solution sketch (try the problem first)
import numpy as np

def apply_transform(T, pts):
    T, pts = np.asarray(T, float), np.asarray(pts, float)
    one = pts.ndim == 1
    P = np.atleast_2d(pts)
    Ph = np.hstack([P, np.ones((len(P), 1))])
    out = (T @ Ph.T).T[:, :3]
    return out[0] if one else out

5. Deep dive: which ML maths matters for robots

TensorTonic's 67 maths lessons are written for ML. Here's how each robotics subsystem uses them:

Maths topic (TensorTonic lesson)Where a roboticist uses it
Matrix multiplication, orthogonalityRotation matrices (orthogonal, det = 1), frame chains
Jacobian & HessianVelocity kinematics (joint speeds → gripper speed), singularities, inverse kinematics
Least squares, SVDCalibration, point-cloud alignment (ICP / Kabsch uses SVD), pseudo-inverse IK
Eigenvalues, positive-definite matricesStability of controllers, covariance ellipses for uncertainty
Covariance, Bayes' theoremKalman filters and sensor fusion: combining IMU + wheel odometry + GPS
Markov chains, Monte CarloParticle filters (localization), MDPs in RL, sampling-based planners
Newton's method, Lagrange multipliers / KKTTrajectory optimization and model-predictive control (MPC) with constraints
Type I vs II errors, hypothesis testingDetector thresholds and safety stops (links to Module 01)
KL divergence, entropyPPO's KL penalty, entropy bonus for exploration, active perception

6. Deep dive: the RL ladder

TensorTonic has a clean progression of RL problems. Climb it in this order. Each rung builds the next:

  1. Foundations: discounted returns → Bellman expectation → Bellman optimality
  2. Planning with a known model: value iteration, policy iteration
  3. Learning from experience: Monte Carlo evaluation → TD(0) → SARSA / Q-learning
  4. Exploration: ε-greedy, UCB1, Thompson sampling
  5. Deep value methods: replay buffer, DQN with target net, Double DQN
  6. Policy gradients: REINFORCE → with baseline → A2C → GAE → PPO clipped objective

Why PPO is the target: PPO with GAE is the workhorse for training locomotion (quadrupeds, humanoids) in simulation before transferring to real hardware ("sim-to-real"). Robot arms use continuous actions, so DQN-style methods matter less there than policy gradients and actor-critic methods.

7. What it doesn't cover

Plan to fill these from other sources (future modules):

8. Playbook

  1. Start free. Upgrade to Pro ($100/yr) only if you want the structured roadmaps and quizzes.
  2. Do ~3 problems a day: 1 maths, 1 geometry/CV, 1 RL. Consistency beats binges.
  3. Read the Theory tab before coding. Peek at the solution only after a real attempt.
  4. Connect GitHub (offered on the problems page) so solutions back up to a private repo. That becomes your own robotics-maths library.
  5. After each stage, port one solution to a mini robot sim (e.g. a 2-link arm in matplotlib or MuJoCo) to make it concrete.

9. Self-check

Why append a 1 to 3D points instead of storing R and t separately?

It turns "rotate then translate" into one matrix multiply. A chain of frames becomes a product of 4×4 matrices, which is forward kinematics.

How do you invert a homogeneous transform cheaply?

T⁻¹ = [Rᵀ, −Rᵀt; 0, 1]. Rotations are orthogonal, so the inverse is the transpose. No general matrix inversion needed.

Which TensorTonic CV problem doubles as a multi-object tracking building block?

Hungarian matching. Trackers use it to assign new detections to existing tracks, usually with IoU or distance as the cost.

Why climb to PPO + GAE rather than stopping at DQN for robotics?

Robot actions (joint torques and velocities) are continuous. DQN needs a discrete action set. PPO handles continuous actions and is stable enough for large-scale simulation training.

Which diffusion paper on TensorTonic is a stepping stone to diffusion policies?

DDPM. Diffusion policies apply the same denoising process to robot action sequences instead of images.

10. Glossary & further reading

TermMeaning
Homogeneous transform4×4 matrix combining rotation and translation between two coordinate frames
Forward kinematicsComputing gripper pose from joint angles by chaining transforms
JacobianMatrix mapping joint velocities to gripper velocity
MDPMarkov decision process: states, actions, transition probabilities, rewards
Bellman equationRecursive definition of value: reward now + discounted value later
PPOProximal Policy Optimization: policy gradient with a clipped update for stability
GAEGeneralized Advantage Estimation: lower-variance advantage estimates for policy gradients
Sim-to-realTraining in simulation, then transferring the policy to a physical robot
VLAVision-Language-Action model: a transformer mapping camera images and instructions to robot actions
Diffusion policyRobot policy that generates action sequences by iterative denoising