TrenTorch

Learn machine learning by building it.

Don't just read about AI. Write it yourself, one small step at a time, and see exactly what your code does. 1647+ practice problems, each with a clear explanation.

Free forever. No subscriptions. Supported by sponsors and donations.

1647

Problems

12

Topics

Start easy, finish hard: 466 beginner · 633 intermediate · 298 advanced problems.

class_weighted_loss.py
Medium
Deep Learning · Cross Entropy

0+

Learners and growing

Learners signing up from top companies and campuses

Based on signup email domains. Not an endorsement, see footer.

What people are saying

Explore the curriculum

From real-world ML problems to rigorous DSA fundamentals.

TrenTorch combines hands-on machine learning challenges with a carefully structured data structures and algorithms sheet. Learn the reasoning, implement the solution, and understand why it works.

01Applied machine learning

Company case studies

Go beyond textbook exercises. Work through company-inspired scenarios in recommendation systems, experimentation, feature engineering, classification and decision trees. Each challenge turns a practical engineering need into a focused implementation problem.

Browse all company case studies
cases / netflix / stable-softmax-logitsMedium

Stable softmax for ranking scores

Netflix case · Medium · NumPy

Convert a model's raw ranking scores into probabilities, even when logits are large enough to make a naive exponential overflow.

def softmax(logits):
    shifted = logits - logits.max(axis=-1, keepdims=True)
    exp = np.exp(shifted)
    return exp / exp.sum(axis=-1, keepdims=True)
HIDDEN TESTS✓ 4 / 4 passed
✓ Large logits — no overflow
✓ Each row sums to one
02Algorithms & problem solving

A DSA sheet built around understanding.

Prepare with a structured, Google-level data structures and algorithms curriculum. Learn the theory, recognize patterns, and practise with real questions from the TrenTorch DSA sheet—then track your progress as you improve.

01

Understand the theoryBuild intuition before jumping into implementation.

02

Recognize reusable patternsConnect ideas across algorithms and data structures.

03

Practise with purposeWork through curated questions and difficulty levels.

Explore the complete DSA sheet
dsa-sheetLearn the idea. Then solve.
Questions from your sheetLive links · TrenTorch DSA
04 · Design and Data Structures2 selected
LRU Cache Intermediate LFU Cache Mastery
03Research papers · Read, annotate, implement

Read the paper. Mark it up.

Open the original paper in your browser. Highlight the lines that matter, draw on the page, and keep notes beside the text. Then implement the paper's ideas yourself, step by step.

Explore papers across every major topic

Explore all research papers
papers / attention-is-all-you-need1 / 15
ReadDrawHighlightTextErase Saved in
this browser

Attention Is All You Need

3.2.1  Scaled Dot-Product Attention
Attention(Q, K, V) = softmax(
QKᵀ / √dₖ) V

← key idea

transformers-llms / scaled-dot-product-attentionIntermediate

Attention Is All You Need: Scaled Dot-Product Attention

The problem, from first principles

Attention Is All You Need (Vaswani et al., 2017) drops recurrence entirely. Each position builds its output by comparing a query with every key, turning similarities into weights, and averaging the values with those weights. Dividing by the square root of the key dimension keeps the softmax from saturating.

From theory to code

Implement scaled_dot_product_attention(Q, K, V), which returns softmax(QK^T / sqrt(d)) V with a row-wise softmax.

Constraints

  • Q and K share the feature dimension d.
def scaled_dot_product_attention(Q, K, V):
    # softmax(QK^T / sqrt(d)) V, row-wise softmax
    ...
hidden testsRun · 0 / 5
04Research papers · Code

Then code the paper.

Every paper comes with questions that start from first principles and end in working code. Implement the idea yourself and run it against hidden tests.

01

The problem, from first principlesWhat the paper is actually solving, in plain terms

02

From theory to codeThe exact function to write, with real shapes and defaults

03

Constraints that matterThe edge cases the paper assumes, spelled out

04

Check it against hidden testsPass everything and the paper is yours

Code the paper

Beyond writing code

The goal isn't just to teach you how to write the code

It's to help you understand what your code is actually doing underneath

Hosting & OSS support by

Thanks to Vercel and Mintlify for providing infrastructure

Free. Money shouldn't be the barrier to learning ML.

We don't charge users and we don't sell your data. TrenTorch runs entirely on sponsorships and donations.

Support TrenTorch
Every gradient is a step into the dark, mapped one connection at a time.
TrenTorch TrenTorch

Real PyTorch signatures, real internals, scored against real offline PyTorch output.

engineering@trentorch.com

Stay in the loop

New questions, problem-of-the-day drops, and release notes.

© 2026 TrenTorch. Source-available, free for personal and educational use , and follows a Code of Conduct .

"Learners signing up from" is based on the email domains people used to sign up, counted in aggregate; no individual is named. It does not mean these organizations endorse, sponsor, or are affiliated with TrenTorch. All names and trademarks belong to their respective owners.