Write the algorithm, train it on a real dataset, and clear the metric.
0 of 108 cleared · 18 datasets
Activation Functions·MNIST
Implement an activation function for a neural network using only NumPy. Your activation(x) function takes an array of values and returns the activated outputs. The training harness handles everything else (forward pass, backpropagation, weight updates). You just define how neurons transform their inputs. You may implement ANY activation function you like: ReLU, sigmoid, tanh, or something creative. Your activation will be used in a simple neural network trained on MNIST.
Normalization·MNIST
Implement a normalization function for a neural network using only NumPy. Your normalize(x) function takes an array of activations and returns normalized outputs. The training harness handles everything else (forward pass, backpropagation, weight updates). You just define how activations are normalized before being passed to the next layer. You may implement ANY normalization strategy you like: LayerNorm, RMSNorm, BatchNorm-style, or something creative. Your normalization will be used in a simple neural network trained on MNIST. Normalization is a critical component in modern
Dimensionality Reduction·MNIST
Implement a dimensionality reduction class MyReducer that projects high-dimensional data down to 10 dimensions. You can use sklearn and NumPy. Your reducer will be evaluated by training a k-NN classifier on the reduced MNIST data and measuring accuracy.
Regularized Regression·California Housing
You are given a regression dataset that has been deliberately over-engineered with polynomial features and noise columns. A naive approach (e.g., LinearRegression()) will badly overfit: near-perfect training R² but catastrophically negative test R². Your task: implement a train function that returns a predict callable which actually generalizes to unseen data. You can use sklearn and NumPy. The harness generates degree-3 polynomial features plus 100 pure noise columns from the original 8-feature California Housing dataset, giving 264 features but only 250 training samples. `LinearReg
PyTorch Fundamentals·MNIST
Implement a function trainmodel(model, Xtrain, ytrain, Xval, yval, epochs, batchsize, lr) that trains a neural network using PyTorch. Use torch.optim for optimization and implement proper batching, shuffling, and validation. Return a list of dictionaries containing training metrics for each epoch.
Machine Learning·Generated at run time
You are handed a regression dataset X (rows are examples) and targets y. Divide it into training, validation and test folds, fit any predictor you like on the training fold only, and return its predictions for the test fold together with the three folds. - testpredictions: a 1-D array with one prediction per row of the test fold, in the order of testidx. - trainidx, validx, `test_idx
Tinygrad Fundamentals·MNIST
Implement a function trainmodel(model, Xtrain, ytrain, Xval, yval, epochs, batchsize, lr) that trains a tinygrad model. Use tinygrad.nn.optim for optimization and implement proper batching, shuffling, and validation. Return a list of dictionaries containing training metrics for each epoch.
Logistic Regression·Breast Cancer Wisconsin
You are given a binary classification dataset where the target is either 0 or 1. Implement a train function that returns a predict callable which classifies new samples accurately. The harness loads the Breast Cancer dataset from sklearn (30 numerical features describing cell nuclei measurements), standardizes the features, splits into train/val/test, and calls your function. Your predict must return an array of 0s and 1s. You can use any sklearn model or approach you like.
Regression·California Housing
Implement a train function that takes standardized training data and randomly initialized weights, and returns trained weights for a linear regression model. The harness handles everything else: data loading, feature standardization, weight initialization, prediction (y = X @ W + b), and evaluation. You just define how the weights get updated. You may use ANY training strategy you like: gradient descent, the normal equation, momentum, adaptive learning rates, mini-batching, or anything else -- as long as you only use NumPy and the returned (W, b) produce good predictions.
Classification·sklearn digits
Some pixels of every digit you will classify are gone, and you do not know in advance how many or which ones. Build a classifier that still gives honest class probabilities when features go missing, at training time and at test time. Section 9.4.3 of the book argues that a generative classifier can handle this in a principled way; here any method is allowed and the scoring rule decides. The data The 8x8 handwritten digits from scikit-learn (1,797 images, 10 classes). Each image is a row of 64 pixel intensities (integers 0 to 16, stored as floats, row-major so pixel 8*r + c is row `r
Machine Learning·Fashion-MNIST
Build the best probability model of small clothing images that you can, under two hard limits: every component of the model is a Gaussian whose covariance is low-rank plus diagonal, and the whole model may store at most 48,000 numbers. Section 20.2 of the book builds this family: factor analysis (eqs. 20.36-20.39), probabilistic PCA (eqs. 20.41-20.46) and mixtures of factor analyzers (eqs. 20.69-20.71). You hand back the parameters and the grader computes the exact held-out log-likelihood from them, so every submission is a normalized density scored on the same footing. The data Fashi
Computer Vision·Olivetti Faces
Section 21.3.3 of the book turns K-means into a compressor: replace each vector by the index of its nearest prototype and you only send $\log2 K$ bits per vector, plus the codebook once, $O(N \log2 K + KDB)$ bits in all. Your job is to rebuild faces you have never seen from 256 bytes each, which is 0.5 bits per pixel, as faithfully as you can. A codebook is the natural place to start; any codec you can write is allowed. The data The Olivetti faces: 400 grey 64 x 64 images of 40 people, 10 images per person, as float32 pixels in [0, 1]. The grader holds out people, not images, so
NLP·Names
Implement a train_tokenizer function that learns a vocabulary from a training corpus of names and returns encode and decode functions. The harness will use your tokenizer to train a bigram language model on the tokenized corpus, then evaluate how well that model predicts held-out names. A better tokenizer creates more predictable token sequences, leading to lower bits-per-character (BPC) on held-out data. You may use ANY tokenization strategy: character-level, byte pair encoding (BPE), frequency-based subword merging, common n-gram extraction, word-level with character fallback, or any
Machine Learning·Adult Census Income
Every row of the Adult census table is a person. For each one you must pick an action: say their income is at most 50K a year (action 0), say it is above 50K (action 1), or reject, deferring the case to a human reviewer (action 2). A wrong answer costs money, a deferral costs a fixed review fee, a right answer costs nothing, and the prices change from one deployment to the next. You only learn them when you are asked to decide. Make the decisions with the lowest total cost. What you write `python def train(Xtrain, ytrain):
Ensembles·sklearn digits
The harness has trained five different classifiers (Logistic Regression, Decision Tree, K-Nearest Neighbors, Gaussian Naive Bayes, Random Forest) on a small training set drawn from sklearn's digits dataset (10-class image classification). Your job is to write a function trainensemble(basemodels, Xval, yval) that combines these pre-trained models into an ensemble classifier with higher accuracy than any single one of them. You receive the trained base models (each with .predict and .predict_proba) plus a validation set you can use to fit any meta-parameters of your combiner -- weight
Data Preprocessing·Boston Housing
Implement a function to handle missing data (NaN values). Your function should fill in all NaN values with reasonable estimates. Your imputed data will be used to train a sklearn RandomForestRegressor on the Boston Housing dataset. Performance is evaluated on Mean Squared Error (MSE). Lower MSE is better. Since MSE is a loss metric, it is converted to an accuracy score using: val_accuracy = 1.0 - (MSE / 50.0). This means MSE of 0 gives accuracy of 1.0, MSE of 25 gives accuracy of 0.5, and the passing threshold of MSE < 35 corresponds to accuracy > 0.3.
Attention & Transformers·IMDB Movie Reviews
Implement an attention mechanism for sentiment analysis on movie reviews. Your attention function will help a neural network learn which words in a review are most important for determining whether the sentiment is positive or negative.
Inference·Generated at run time
A fleet of identical inference replicas serves a traffic stream that rises and falls. Every replica costs money for every second it exists, including the seconds it spends booting, and a new replica takes a fixed cold-start time to become ready. Your autoscaler decides, once per second, how many replicas the fleet should have. The grader charges you for the replica-seconds you used and penalizes every second in which requests were queueing. `python class Autoscaler: def init(self, minreplicas, maxreplicas, replicacapacity, coldstart_s): ...
Inference·Generated at run time
An inference replica keeps a prefix cache of KV blocks so that a prompt whose beginning it has already processed can skip that part of prefill. The cache holds a fixed number of blocks, and when it is full something has to go. You decide what: which blocks are worth keeping, which are worth admitting in the first place, and which one to evict when space runs out. The grader replays a hidden stream of prompts through a cache driven by your policy and reports the token hit rate. `python class EvictionPolicy: def init(self, capacity_blocks):
Mixture of Experts·MNIST
Implement a routing function for a Mixture of Experts (MoE) layer using only NumPy. Your route(x, Wgate) function takes hidden activations and a gate weight matrix, and returns per-expert weights that determine how much each expert contributes to the output. The training harness handles everything else: the input layer, expert computations, combining expert outputs using your weights, the output layer, and backpropagation. You just decide which experts to use and how much. This lab uses 32 experts** with small capacity (16 neurons each) — close to real MoE architectures where ma
Optimizers·MNIST
Implement an optimizer update rule using only NumPy. You will write a function optimizerstep(param, grad, state, lr) that takes a parameter array and its gradient, then returns the updated parameter. The training harness handles forward/backward passes and gives you the gradients—you just decide how to update the weights. You may implement ANY update rule** you like: vanilla SGD, momentum, RMSprop, Adam, or something creative. Your optimizer will train a simple neural network on MNIST.
Deep Learning·MNIST
Design your own post-training quantization (PTQ) scheme for an MLP trained on real MNIST. MNIST is loaded from the same Google TF/Keras host used by other Deep-ML labs (storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz). You get the trained FP32 weights and a calibration batch of real flattened digits in [0, 1]. Apply any classical PTQ idea (bit-width, symmetric/asymmetric, per-tensor or per-channel, calibration, GPTQ-style compensation…), then return dequantized weights. Graded on mean cosine similarity of logits vs the FP32 model on a held-out MNIST spl
Machine Learning·Adult Census Income
Design your own tabular binary classifier on the real Adult Census Income dataset (UCI / OpenML). Predict whether a person earns >50K (class 1, minority). You receive pandas DataFrames with mixed numeric and categorical columns — raw, with missing values. Build any classical pipeline: imputation, encoding, scaling, imbalance handling, model choice, calibration. Return predictproba(X) scoring the positive class. Graded on PR-AUC (average precision) on a held-out split. Majority-class dummies fail; a careful classical pipeline passes. No deep learning.** NumPy
GPU Kernels·Generated at run time
Write the fastest CUDA kernel you can for the most basic reduction there is: add up 67 million floats. The yardstick is NVIDIA's own CUB library, whose cub::DeviceReduce::Sum is timed against yours on the same GPU, on the same data, in the same run. The leaderboard ranks by speedup = CUB's time / your time, higher is better. Matching CUB scores 1.0; beating it scores more. Contract. Your file must define x and out are device pointers that the harness already allocated: x holds n floats, out one
Clustering·sklearn digits
You are given a tiny labeled set (20 samples = 2 per class) and a much larger unlabeled set (1300 samples) drawn from sklearn's digits dataset. A classifier trained on the 20 labels alone gets around 65-70% accuracy -- well below the threshold. Your job is to use the unlabeled data to do meaningfully better. The standard approach (covered in Chapter 9 of Hands-On ML) is cluster-based label propagation: cluster all the data, propagate labels from the labeled samples to entire clusters, and train a downstream classifier on the resulting pseudo-labeled set. The harness reports two reference
Machine Learning·MNIST
Build a probability model of handwritten digits and make it as unsurprised as possible by digits it has never seen. Section 1.3.4 of the book scores unsupervised models by the negative log-likelihood of held-out data (eq. 1.33), and section 3.5.2 fits a Bernoulli mixture to binarized MNIST (Fig. 3.13). Here the held-out log-likelihood is computed exactly by the grader, and it is your leaderboard score. The data MNIST digits, 28 x 28, binarized: a pixel is 1 when its gray level is above 127 (half of 255), else 0. Each image is flattened row by row into 784 pixels, so pixel d sits at
PyTorch Fundamentals·Generated at run time
Implement ordinary least squares linear regression using only PyTorch autograd. Do not use torch.optim or closed-form solvers. Task Write fitlinearregression(X, y, lr=0.1, steps=500) that: 1. Initializes parameters w (shape (D,)) and b (scalar) with requires_grad=True. 2. Runs full-batch gradient descent for steps iterations minimizing mean squared error (MSE): L = mean((X @ w + b - y)^2). 3. Uses autograd (loss.backward()) to obtain gradients and manually updates parameters with the learning rate lr. 4. Returns the
Regularized Regression·California Housing
You are given a regression dataset that has been deliberately over-engineered with polynomial features and noise columns. A naive approach (e.g., ordinary least squares or unregularized gradient descent) will badly overfit: it achieves near-perfect training R² but catastrophically negative test R². Your task: implement a train function that returns a predict callable which actually generalizes to unseen data. You must use ONLY NumPy. The harness generates degree-3 polynomial features plus 100 pure noise columns from the original 8-feature California Housing dataset, giving ~264 features
Regression·California Housing
A price estimate is only useful with honest error bars. With 200 sales to learn from, you cannot know much, and you know least about houses that look like nothing you have seen. Section 11.7.4 of the book makes this concrete: the plug-in predictive $\mathcal{N}(y \mid \hat{w}^\top x, \sigma^2)$ (eq. 11.125) gives every house the same error bar, while the posterior predictive $\mathcal{N}(y \mid \muN^\top x, \sigma^2 + x^\top \SigmaN x)$ (eqs. 11.123-11.124) widens it where the training data say little. Your job: from 200 California block groups, give a Gaussian predictive distrib
Language Modeling·TinyStories
Build the best character-level language model of TinyStories you can inside a training budget. Any method counts: smoothed n-grams, an MLP over a context window, a recurrent net, a small transformer, or a mixture of several. The leaderboard ranks by bits per character on held-out text, lower is better. Contract. Implement two functions: - train(text: str) -> model receives the training slice as one string and returns any object. - logprob(model, seq: str) -> list[float] returns one natural-log probability per character of seq: entry i is log p(seq[i] | seq[:i]). The first e
Regression·Generated at run time
A motor insurer prices every policy by the number of claims it expects the policy to make. Section 12.5 of the book fits this on the French motor third-party liability portfolio (freMTPL2): most policies never claim, the rest claim once or twice, and the metric that separates good models from bad ones is the Poisson deviance, not the squared error. Your job is to predict expected claim counts for policies you have not seen, as well as you can. The data The grader builds a portfolio with the freMTPL2 rating factors and a hidden claim-rate law: the expected claims of a policy depend
PyTorch Fundamentals·Generated at run time
Build and train a multi-layer perceptron (MLP) for binary classification that uses nn.BatchNorm1d and nn.Dropout for stable training and regularization. Goals 1. Implement RegularizedMLP with at least two hidden blocks. Each hidden block must contain, in order: nn.Linear -> nn.BatchNorm1d -> nonlinearity -> nn.Dropout. 2. The final layer must map to a single logit (shape (N,) after squeeze) for binary classification. 3. Implement train_model using nn.BCEWithLogitsLoss and an Adam optimizer. Train on the tensors the harness pro
Optimizers·MNIST
In this open-ended challenge, you will implement your own optimizer in PyTorch. The optimizer can be inspired by existing ones (SGD, RMSProp, Adam, etc.) or be completely new — your design choice. You must subclass torch.optim.Optimizer and implement the step() method. Your optimizer will be tested on a small CNN trained on the MNIST dataset. The goal is to achieve good accuracy (≥80%) within a few epochs. You are free to use any update rule, momentum terms, normalization tricks, or bias corrections you like. Creativity is encouraged — as long as the optimizer works and converges on MNIS
Optimizers·MNIST
In this open-ended challenge, you will implement your own optimizer in tinygrad. The optimizer can be inspired by existing ones (SGD, RMSProp, Adam, etc.) or be completely new - your design choice. You must subclass tinygrad.nn.optim.Optimizer and implement the schedule_step() method (the base class's step() realizes its returned tensors for you). Your optimizer will be tested on a small CNN trained on MNIST. The goal is to achieve good accuracy (>= 80%) within a few epochs. You are free to use any update rule, momentum terms, normalization tricks, or bias corrections you like. Creativ
Model Architecture·MNIST
Implement a function buildmodel() that returns a PyTorch nn.Module to classify MNIST digits. You may use ANY layers/ops, but if your model has more than 2048 trainable parameters, your reported accuracy will be 0**. Keep it tiny and clever (e.g., global pooling, grouped/depthwise convs, shared weights, etc.).
Model Architecture·MNIST
Implement a function buildmodel() that returns a tinygrad model (any plain Python class with call) to classify MNIST digits. You may use ANY tinygrad ops, but if your model has more than 2048 trainable parameters, your reported accuracy will be 0. Keep it tiny and clever (e.g., global pooling, grouped/depthwise convs, shared weights, etc.). Tinygrad does not use an nn.Module base class - your model is just a regular Python class with init storing submodules as attributes and a call__ method that runs the forward pass. Parameters are discovered by walking the c
Network Optimization·MNIST
You're given a very deep network (30 layers) that suffers from training problems, achieving only 20% accuracy. Your task: fix the architecture to achieve high accuracy while maintaining the depth (≥30 layers)**. The baseline deep network trains poorly due to vanishing gradients. You can modify the architecture however you like (skip connections, normalization, etc.) but you must keep at least 30 layers. Solutions with <30 layers automatically score 0.
Data Pipelines·MNIST
Implement a custom transformation class MyTransform to modify each input image tensor used by a PyTorch DataLoader. The DataLoader will apply your transform through a provided collate function, so your implementation must define how each image is transformed before training. The goal is to learn to integrate PyTorch transformations directly into data pipelines.
Data Pipelines·MNIST
Implement a custom transformation class MyTransform to modify each input tinygrad image tensor used during training. The harness will iterate over MNIST samples one at a time, call your transform on each image, and stack the results into a batch. Tinygrad has no PyTorch-style DataLoader class - the framework prefers explicit batching with Tensor.randint over X_train. This problem teaches the same per-sample transform lesson using a plain Python loop the harness provides.
Logistic Regression·Generated at run time
With twenty labelled examples, a logistic regression can be very sure of itself and very wrong. Section 10.5 of the book shows the problem on a small separable data set (Figure 10.13): many decision boundaries fit the training points perfectly, the maximum-likelihood weights run off to infinity, and the plug-in prediction $p(y = 1 \mid x, \hat{w})$ becomes 0 or 1 everywhere away from the boundary (Figure 10.14a). Your job is to output class probabilities that are as honest as possible: confident where the twenty labels justify it, and not elsewhere. The tasks The grader generates many
Reinforcement Learning·Generated at run time
Earn as much reward as you can on k-armed bandit problems whose true action values never stop changing. This is the nonstationary testbed of Exercises 2.5 and 2.11 in Sutton and Barto, extended to harder variants. The leaderboard ranks by the share of the attainable reward you capture over the second half of each 200,000-step run, in percent, higher is better. Contract. Define a class Agent: - Agent(nproblems, k, nsteps) is created once per regime. One agent plays nproblems independent bandit problems side by side, each with k arms, for nsteps = 200,000 steps. - `act()
Dimensionality Reduction·MNIST
Implement a dimensionality reduction class MyReducer that projects high-dimensional data down to 10 dimensions using NumPy. Your reducer will be evaluated by training a k-NN classifier on the reduced MNIST data and measuring accuracy.
PyTorch Fundamentals·MNIST
Implement a function trainstep(model, xbatch, y_batch, lr) that performs ONE step of gradient descent training. You must manually: (1) compute the forward pass, (2) compute the loss, (3) compute gradients using backpropagation, and (4) update the model parameters. Do NOT use torch.optim - update weights yourself using the gradients. This teaches how gradient descent actually works in PyTorch.
Tinygrad Fundamentals·MNIST
Implement a function trainstep(model, xbatch, ybatch, lr) that performs ONE step of gradient descent training. You must manually: (1) compute the forward pass, (2) compute the loss, (3) compute gradients using backpropagation, and (4) update the model parameters. Do NOT use tinygrad.nn.optim - update weights yourself using the gradients. This teaches how gradient descent actually works in tinygrad. Tinygrad's lazy evaluation means assignments to parameters do not run until you ask for them to be realized. You'll need to call Tensor.realize(params) (or rely on a subsequent .item()
Reinforcement Learning·Pairwise preferences
You will align a discrete policy to pairwise human (synthetic) preferences using Direct Preference Optimization — no separate reward model and no PPO loop. Setup There is a catalog of nitems items. Each training example is a pair of indices (chosen, rejected) where the chosen item was preferred. Preferences were generated from a hidden Bradley–Terry quality vector with a little label noise. A frozen uniform reference over the catalog is assumed: $$\pi{\rm ref}(i) = 1/n{\rm items}$$ Your job is to learn a policy $\pi\theta$ (or an
Numerical Methods·Generated at run time
Every deep-learning framework ships a softmax, a log-softmax and a cross-entropy that subtract the row maximum and call it numerically stable. Barron, Gnanapragasam and Tschannen (2026) show they are not: once the correct logit leads the others by more than a precision cliff (about 5.5 in bfloat16, 16.6 in float32) the target's gradient rounds to exactly zero while the other entries do not, so the gradient stops summing to zero (Softmax Collapse), and a student scored against its own teacher's distribution receives a nonzero gradient (Softmax Cancellation). Their fix recomputes everyth
Inference·Generated at run time
Route every request of a live LLM serving trace to one of several identical replicas so that users see their first token as soon as possible. Each replica keeps its own prefix cache, so where a request lands decides both how much of its prompt has to be recomputed and how long it waits behind other requests. The leaderboard ranks by mean P90 time to first token in milliseconds, lower is better. Contract. Define a class Router: - Router(nreplicas, blocksize, g1blocks, g2blocks) is created once per trace (block_size is 64 tokens). - route(request, replicas) -> int returns t
Computer Vision·CIFAR-10 (subset)
You get about 8,000 labelled CIFAR-10 images, one GPU and a stopwatch. Build whatever you think learns fastest, train it before the time runs out, and classify about 4,000 images you have never seen. The most accurate classifier wins. Any method is allowed. The only things that count are the accuracy you reach and whether you finish on time. What you write `python def train(Xtrain, ytrain, budgetseconds): ... return model # anything you like def predictproba(model, X): ... return P
Machine Learning·Fashion-MNIST
Somebody labelled a batch of Fashion-MNIST images in a hurry. Many labels are wrong, nobody says which, and the corruption is different every time. Write a training procedure that, given only the pixels and these noisy labels, returns a classifier whose probabilities are as good as possible for the true labels. What you write - X_train: float32 array of shape (12000, 784), pixels scaled to
Machine Learning·sklearn digits
You are handed a table of points and nothing else: no labels, and not even the number of groups. Find the groups. Every task comes from a generator that knows the true cluster of each point, so your partition can be scored against the truth. Some tasks are blobs, some are shapes no blob model describes, some are binary vectors, one family is real handwritten digits, and on Submit four whole families appear that Run never shows you. One function has to handle all of them. Your function `python def cluster(X, kind): ... return labels # integer numpy array, shape (len(X
Inference·Generated at run time
Serve a mixed stream of LLM requests on a fixed 64-GPU cluster and decide, request by request, where each prompt is prefilled; at the same time decide how many nodes form the prefill pool. The leaderboard ranks by goodput: the percentage of requests that meet both their time-to-first-token (TTFT) and their decode-speed SLO, higher is better. The cluster. 8 workers, each an 8-GPU node holding a full replica of a large MoE model. A worker is either a decode worker or a prefill worker, and you can change the split while traffic runs. Every request is assigned to one decode worker, wh
50,000 token positions · 512-dim residual stream after block 3 of Pythia-70m on TinyStories · float16
Interpretability·Pythia-70m residual stream (layer 3)
Learn the best sparse dictionary of a language model's residual stream that you can inside a training budget. The activations are the 512-dimensional residual stream after block 3 of Pythia-70m on TinyStories text. Any method counts: an L1 sparse autoencoder, a top-k or JumpReLU autoencoder, dead-latent resampling, k-SVD, orthogonal matching pursuit, or something of your own. The leaderboard ranks by explained variance of held-out activations, higher is better, under a fixed sparsity budget. Contract. Implement three functions: - train(X_train) -> model receives a float32 array of
Compilers·Generated at run time
After rangeify, every op in a model graph is a loop nest, and the compiler still has to decide which intermediate results get written to memory. You decide. For each graph, choose which nodes to STAGE (materialize into a temporary buffer) and which staged nodes share a kernel. Every node you do not stage is fused into the kernels that use it and recomputed there. The plans are priced with a fixed roofline cost model, and the leaderboard ranks by percent of the ideal time, higher is better. Contract. Define plan(graph). It is called once per graph and returns an iterable of kerne
Machine Learning·Generated at run time
You get a table of numbers drawn from a density you are never told, and you answer with a mixture of at most 32 full-covariance Gaussians. The grader knows the true density, computes your mixture's density itself, and measures how far apart the two are. The closest mixture wins. What you write - X_train: float64 array of shape (N, D), one sample per row, with $D$ from 2 to 16 and $N$ from 120 to 4,000. Columns com
Compilers·Generated at run time
Week 1 of a compiler course: your compiler holds a program as a graph of UOps and rewrites it. Write optimize(root) that returns a program computing exactly the same value as root for every input the program can receive, using as few nodes as you can. The leaderboard ranks by percent of nodes removed, higher is better. Contract. Define optimize(root). It is called once per program with the program's root UOp and must return a UOp. The grader provides the class UOp before calling optimize; use it inside your functions, and do not define a module-level name UOp yourself.
NLP·IMDB Movie Reviews
The book trains an embedding and a small MLP on the IMDB movie reviews and reports 86% validation accuracy (Section 13.2.4.3), then spends Chapter 15 on models that read reviews as sequences. Here you train on whole reviews and predict from a short excerpt of each held-out review, in a fixed amount of T4 time and with nothing pretrained. Build whatever you think works best, and compete on log loss. What you write `python def train(docs, labels, vocabsize, budgetseconds): ... return model # a
Machine Learning·California Housing
Fill in the missing entries of a real data table and say how sure you are about each one. The grader hides about 30% of the entries of a numeric table. For every hidden entry $x$ you return a predictive mean $m$ and a predictive variance $v$, and you are scored by the Gaussian negative log-likelihood of the true value: $$\mathrm{NLL} = \tfrac{1}{2}\log(2\pi v) + \frac{(x - m)^2}{2v}$$ averaged over the hidden entries, in nats. A confident guess that is right scores well, a confident guess that is wrong is punished hard, and a vague guess sits in between. The leaderboard ranks by the **me
Inference·Generated at run time
One GPU replica serves a 32B model to three kinds of traffic at once: code completions with tight latency targets, long-context chat, and offline batch jobs that only need to finish. Inference engines expose many knobs, and the right setting changes with the traffic. Write the controller that sets them, one engine iteration at a time. The grader replays a hidden traffic trace through a simulated engine driven by your controller and scores the work served within each request's latency targets. `python class Controller: def init(self, engine):
Language Modeling·TinyStories
Mamba asked one question: can a model that carries a fixed-size memory from token to token, so it runs in linear time with constant memory per sequence, match attention on language, including the part attention is best at, recalling something seen far back? Build the best character-level language model you can under that constraint. Any design counts: a selective state space model, a gated RNN, linear attention, a sliding window that fits the cap, an n-gram mixed with a learned memory, or something new. The leaderboard ranks by score, lower is better. Data. TinyStories, with recal
Machine Learning·Fashion-MNIST
Goal You get 10,000 unlabeled Fashion-MNIST images and one labeled example of each of the 10 classes. Each round you may ask an oracle for the labels of 10 more pool images; there are 9 rounds, so you end with 100 labels. After every round the harness retrains its own classifier on everything labeled so far and measures accuracy on held-out images. You control only which images get labeled. Choose queries that make that classifier accurate as early as possible. What you write `python def select(Xpool, labeledidx, ylabeled, k, roundidx, pool_proba): return [...]
Graph Learning·Generated at run time
Someone has hidden 10% of the links of a graph. From what is left, and from the node features, rank the missing links above the pairs that were never linked. Your score is the AUC of that ranking, averaged over graphs whose structure you are not told. The graphs come from three families, and each graph is generated fresh by the grader from a hidden seed: - Community: nodes belong to hidden groups, and the pair of groups sets the link rate. - Hierarchical: nodes sit in a hidden hierarchy (nested groups or a taxonomy), and the link rate falls w
Linear Algebra·Generated at run time
Section 7.5.5 of the book says the truncated SVD $\hat{A}k = Uk Sk Vk^\top$ is the best rank-$k$ approximation of $A$ in Frobenius norm. Computing it normally starts from the whole matrix. Here you never see the matrix: you may only multiply by it, and every product is counted. Build the most accurate rank-$k$ approximation you can from a fixed number of products. Any method is allowed. Your function - shape is (m, n), the shape of the hidden matrix $A$. k is the target rank. budget
Statistics·Generated at run time
Section 6.3 of the book defines the mutual information between two random variables, $I(X;Y) = \mathbb{E}\left[\log \frac{p(x,y)}{p(x)p(y)}\right]$, and section 6.3.5 gives one continuous case in closed form: for a bivariate Gaussian with correlation $\rho$, $I(X;Y) = -\frac{1}{2}\log(1-\rho^2)$ (eq. 6.70). For almost everything else the joint density is unknown, and the book warns that the estimate depends heavily on how you discretize, then points to nearest-neighbour methods as an alternative. Here you are given only samples, and the grader knows the true answer. Build the estimator with t
20M-parameter gpt-oss-architecture LM · 6 layers · 16 experts top-4 · 94% of weights in the experts · float32
Inference·Mini gpt-oss (character-level, TinyStories)
gpt-oss ships its mixture-of-experts weights in MXFP4: every block of 32 consecutive weights shares one power-of-two scale, and each weight keeps only a 4-bit floating-point value. The experts hold about 90% of gpt-oss's parameters, so this format is what lets the 120B model fit on a single 80 GB GPU. How you choose the scales and the 4-bit values decides how much of the model survives. This lab hands you a small gpt-oss and asks you to quantize its experts as well as you can, by any method. The leaderboard ranks by how far the quantized model's predictions drift from the original, **KL di
Machine Learning·Generated at run time
Label propagation assumes that neighbours share a class. A feature-only classifier assumes the graph has nothing to say. Each is right on some graphs and badly wrong on others, and with only 20 labelled nodes per class you have to work out which situation you are in. Section 23.6.2.1 of the book poses this task: one partially labelled graph, a label for a small fraction of its nodes, and the node features and links to fill in the rest. Your job is to build the node classifier with the highest accuracy across many graphs. Any method is allowed. The data Every graph comes from a seeded
Statistics·Generated at run time
You run a platform with tens of thousands of groups: ads, products, coins, sellers. For each group you have seen $N$ trials and $N1$ successes, and you must predict the probability that the group's next trial succeeds. Most groups have almost no history (zero to five trials), a few have hundreds. Every group also comes with six numeric features. The success rates were drawn from a hidden prior that differs from dataset to dataset. The maximum likelihood answer $N1 / N$ predicts that a group with 0 successes in 2 trials never succeeds, and says
Regression·Generated at run time
You get a handful of noisy $(x, y)$ pairs, sometimes only five, and must say not just what $y$ will be at new inputs but how sure you are. Section 5.2 of the book picks a polynomial degree for exactly this kind of data (Figures 5.5 and 5.6: degree 1 wins at $N = 5$, degree 2 at $N = 30$), and section 4.6.7 warns that plugging one fitted model into the likelihood makes the predictions overconfident. Here you are scored on the whole predictive distribution, over thousands of tiny datasets. Your function `python def predict(xtrain, ytrain, x_test): ... return mean, std # two nu
Machine Learning·Generated at run time
Section 13.6.2 of the book warns that a model trained with a unimodal output density, "even if the model is a flexible nonlinear model, such as neural network", works poorly on one-to-many functions, where one input has several possible outputs. It "will just produce a blurry average output". Figure 13.23a shows the classic case: an inverse problem where the middle of the input range has two equally probable answers. Here every problem comes from a hidden generator whose true conditional density $p^*(y \mid x)$ the grader knows. You return a Gaussian mixture for each input, and the grader mea
Regression·Generated at run time
Predict a noisy seasonal time series where you have no data, and say how sure you are. The leaderboard ranks by the mean log predictive density of the hidden observations, in nats per point, higher is better: a sharp prediction in the right place scores high, a confident miss is punished hard, and a vague prediction scores low everywhere. Contract. Define two functions: - fit(ttrain, ytrain) receives one series: float arrays of shape (n,) with the observation times (sorted) and the noisy values. It returns nothing; keep what you need in module-level state. It is called once per
320 decode steps · 64 sequences · 5 Pythia-70m draft tokens with 6 features each · greedy acceptance by Pythia-160m
Inference·Speculative-decoding draft confidences and acceptances
Decide how many draft tokens each sequence in a decode step gets verified, and beat fixed-length verification by as much as you can. The data is real: a Pythia-70m draft model proposed 5 tokens for each of 64 sequences per step on story and novel text, and a Pythia-160m target checked them greedily. For every draft token you get six features from the draft model (its probability for the token, the top-1 to top-2 log-probability margin, the draft distribution's entropy, the position in the draft, whether the token starts a word, its length in characters). You never see the target. The leaderboa
Classification·sklearn digits
Implement a train function that learns to classify handwritten digits using ONLY Python and the math standard library. The harness loads the sklearn digits dataset (8x8 pixel images of digits 0-9, giving 64 features per sample), normalizes pixel values to [0, 1], and passes training and validation data as nested Python lists. You must return a predict function that classifies new images. You may use ANY approach: nearest-neighbor, centroid classifier, logistic regression, neural network with hand-rolled backprop, decision trees, or anything creative -- as long as you only use Python and
Ensembles·sklearn digits
Implement a DecisionTree class. The harness creates 30 instances of your tree, trains each on a different bootstrap sample of the training data, and aggregates their predictions by majority vote to form a Random Forest. You are scored on the ensemble's accuracy on a held-out test set, not on any single tree's accuracy. The dataset is sklearn's digits dataset (8x8 handwritten digit images, 10 classes, 64 features). Features are standardized before being passed to your tree. To clear the passing threshold, the trees in the ensemble must be diverse -- bootstrap sampling alone is not en
NLP·TinyStories
Most language models still start with a tokenizer that someone built by hand. The H-Net paper (Hwang, Wang and Gu, 2025) asks whether a model can learn to split raw bytes by itself, while it trains. This lab hands you the part of an H-Net that stays fixed and leaves everything else to you: how to read bytes, where to cut them, and how to turn chunks back into predictions. The leaderboard ranks you by bits per byte on text you never train on. Lower is better. The text is scrambled. The grader takes TinyStories and swaps every byte value for another, using a secret permutation that chan
Machine Learning·California Housing
Predict the price of a California neighbourhood as a full predictive distribution, and make that distribution as sharp as you can while keeping it honest. Each row is a census block group from the 1990 California census; the target is its median house value. The leaderboard ranks by mean test Gaussian negative log-likelihood in nats per point, lower is better. Contract. Implement two functions: - fit(Xtrain, ytrain) -> None receives Xtrain, float64 of shape (16000, 8), and ytrain, float64 of shape (16000,). Keep whatever you need in module-level state. - `predict(X_
Inference·Generated at run time
Run the GPU fleet behind four models in four regions for one simulated week, and pay as little as possible while serving the traffic. The leaderboard ranks the weekly bill in dollars (GPU spend plus SLA penalties), lower is better. Clearing $30,000 counts as solved; everything below that is leaderboard. The world. Time moves in 10-minute ticks (1,008 per week). Regions: us-east (UTC-5, prices x1.00), us-west (UTC-8, x1.04), eu-west (UTC+1, x1.12), ap-northeast (UTC+9, x1.20). Moving a request between regions adds 5 ms one way per time zone of separation. GPUs (FP8 dense c
Compilers·Generated at run time
Once a compiler lowers a tensor program to loops, movement ops (reshape, permute, expand, shrink, pad, flip, stack) stop being free bookkeeping. Every element a kernel reads needs an address: the flat index into the input buffer, plus a flag saying whether the element is real data or padding. That arithmetic runs once per element of every load, so its cost matters. Write the lowering that turns a chain of movement ops into this index math using as few ALU ops as you can. The leaderboard ranks by relative cost, lower is better. Contract. Define `lower(chain) -> (indexexpr, validexpr)
Deep Learning·Generated at run time
A transformer has no built-in reason to keep a compact, consistent internal state: attention can always re-read the raw history, so nothing forces the hidden state ht to be predictable from h(t-1) and the next token. Next-Latent Prediction (Teoh et al., 2025) argues that if you add a training signal that makes hidden states predictable in latent space, the transformer forms coherent latent dynamics - and those dynamics can then be used as a free draft model for speculative decoding. This lab hands you the
Inference·Generated at run time
You are given the weight matrices of a small network whose weights contain a few large outlier channels, the way real transformer layers do, and a budget of four bits per weight on average. Compress each matrix into an integer representation plus whatever side information you like, then reconstruct it. The grader measures how much the network's outputs move on held-out inputs, and it counts every bit you used. `python def quantize(W, bits): ... return q # a dict of numpy arrays def dequantize(q): ... return W_hat # float array with
Inference·Generated at run time
One inference replica, a stream of requests, a fixed budget of KV cache blocks and a cap on how many sequences can decode at once. Before every step the replica asks your scheduler what to do: which waiting requests to admit, which running requests to preempt, and how many prompt tokens to prefill this step. The grader replays a hidden trace through a replica simulator driven by your decisions and reports goodput, the fraction of requests that finished within their latency objectives. `python class Scheduler: def init(self, maxbatch, totalblock
Compilers·Generated at run time
You are writing the back end of an ML compiler. For each attention program your codegen returns C source. The grader compiles it, checks every result, and races it against PyTorch's fused CPU attention (torch.nn.functional.scaleddotproductattention) on the same machine, with the same thread budget and the same instruction set. The leaderboard ranks by geometric-mean speedup over PyTorch, higher is better. 1.0 means you match PyTorch. Contract. Define codegen(program) -> str. The string is C (gnu11) that defines `c void attention(const float q, const float k, const float
Compilers·Generated at run time
Week 6 of the course is where timing starts to matter. Your compiler receives a matrix-multiply program written in the course's .uir format and must emit C. The harness compiles your C, checks every result, and times it against a reference kernel compiled in the same machine with the same flags. The leaderboard ranks by geometric-mean speedup over the reference, higher is better. Contract. Define codegen(program, bench) -> str. - program is the text of one .uir program (format: the course spec; the starter code already includes a parser you may keep or replace). - Return C so
Compilers·Generated at run time
Week 7 of Compilers for Machine Learning turns the compiler into a GPU compiler. In this lab you write only its back end: a function that turns a UOp program into CUDA C++. The grader compiles your source with nvcc, runs it on a Tesla T4 and times it against PyTorch running the same computation. Your score is how much faster (or slower) you are. What you write It returns the complete source of one CUDA C++ file that defines bufs[0] is the output and bufs[1 + i] is the input `BUFF
Reinforcement Learning·Generated at run time
Drive a race car around a right turn you have never seen, as in the racetrack task of Sutton and Barto (Exercise 5.12 and Example 8.6). On each hidden track your agent gets a fixed budget of driving steps to learn from; then the policy it ends up with is scored by the exact expected number of steps it needs to cross the finish line. The leaderboard ranks by expected lap time divided by the best possible lap time on that track, averaged over tracks, lower is better (1.0 means you drive the optimal policy). Contract. Define a class Agent: - Agent(nrows, ncols, step_budget) is cre
Reinforcement Learning·Generated at run time
Teach an underpowered car to reach the top of a hill, and learn it as fast as possible. This is the Mountain Car task of Example 10.1 in Sutton and Barto, played on worlds your agent has never seen: it does not know which action is which, how its observations are scaled or oriented, or exactly how strong the engine and gravity are. The leaderboard ranks by the book's own "early performance" measure: steps per episode averaged over the first 50 episodes, lower is better. Contract. Define a class Agent: - Agent(obslow, obshigh, nactions) is created once per run; obslow and `o
Compilers·Generated at run time
Weeks 9-10 of the course put a real language model through your compiler. Here you are the back end: write a Python function that, given a model's exact shapes, generates C source for running it. The grader compiles your C, runs a prompt through it and then decodes token by token, and times it against a baseline compiled in the same container. The leaderboard ranks by speedup over the baseline, higher is better. Contract. Define codegen(cfg) -> str. It is called once per model and returns one C translation unit that exports: `c void llmcreate(const float *weights); void ll
Feature Deconfounding·Colored MNIST
You are training a digit classifier on Colored MNIST, where each digit is colored with a class-correlated color (e.g., 0s are usually red, 1s are usually green). During training, colors are 80% correlated with digit class, creating a shortcut the model can exploit. At test time, colors are only 30% correlated, so a model relying on color will perform poorly. Your task is to implement a FeatureDeconfounder layer that removes the linear influence of color metadata from neural network features during training, forcing the model to learn digit shapes instead of color shortcuts.
Compilers·Generated at run time
You are writing the loop scheduler of a compiler. It receives loop nests like the GEMMs, convolutions and transposes of week 3, written as plain RANGE loops, and decides in which order, and in which tiles, their iterations run. The arithmetic never changes, only the order of iterations. The order decides how often data has to come back from memory. Every schedule is replayed through a simulated two-level cache, and you are scored on its misses. The leaderboard ranks by cost relative to the compulsory misses, lower is better. Contract. Define `schedule(nest) -> list of (loop_name, st
Optimization·Generated at run time
Every optimizer in the chapter claims to be fast. Here you get a hidden objective, a small budget of gradient evaluations and a starting point, and you return the point you want scored. The objectives include badly conditioned bowls, curved valleys, functions with kinks, and oracles that answer with noise, and your code is never told which one it is facing. The smallest remaining gap to the optimum wins. What you write minimize
LLM Fine-Tuning·TinyStories
You get a distilgpt2 model loaded on a T4 GPU, a tokenizer, and two lists of short text samples drawn from the TinyStories dataset (children's-book-simple stories that distilgpt2 has never seen). Your job is to fine-tune the model on traintexts so the held-out valloss drops as low as possible — using any method you like. Your contract Implement this function: `python def train(model, tokenizer, traintexts, valtexts): # ... your training logic here ... retur
Optimization·Generated at run time
Barron, Gnanapragasam and Tschannen (2026) show that the standard cross-entropy breaks training once a model becomes confident: past a precision cliff (a logit margin of about 16.6 in float32) the target's gradient rounds to exactly zero, Adam's second moment collapses, weight decay drags the margin back under the cliff, and the restored gradient lands as a loss spike, the Slingshot. Their answer is a loss rewritten in log space. This lab hands you the training run and asks you to make it behave, by whatever means you think right: the paper's loss, a different loss, a gradient projection, a ch
Statistics·Generated at run time
You get a sample of 2-D points from a density you are never told, and you answer with a density. The hidden densities have thin rings and tubes, regions with hard edges, swarms of tiny clusters and heavy tails, and your code is never told which one it is facing. The grader knows each true density exactly, so it measures your expected held-out log-likelihood against the best possible value, with no test-set luck in the number. What you write `python def fit(X_train): ... return model # anything
Machine Learning·Adult Census Income
Give gradient boosting as many trees as it wants on Adult Income and most sensible setups land on nearly the same log loss. A size limit changes that. Here you hand over a tree ensemble with a fixed total number of leaves, however you built it, and its log loss on rows your code never sees is your score. Single trees, forests, boosting and anything else you can express as trees all compete on the same budget. What you write fit runs once per task, each t
Compilers·Generated at run time
In week 2 your compiler gets memory. Global buffers persist, temporaries live in one scratch arena, and loads and stores must stay in order. Write the memory planner: for each program, choose the order the steps run in and where every temporary sits in the arena. The leaderboard ranks by arena size relative to a lower bound, lower is better. Contract. Define plan(program) -> (order, offsets): - order is a list naming every step exactly once, in the order the steps will run. - offsets is a dict giving every temporary an int byte offset in the arena (non-negative, a multipl
Machine Learning·Generated at run time
A catalog has thousands of users and thousands of items, and users have given a small share of those items a star rating from 1 to 5. Predict how much each user would like the items they have not rated. Some of those pairs look like what users usually pick, some are items they would never have opened, and some involve a user or an item that has no ratings at all. What you write `python def fit(users, items, ratings, nusers, nitems, userfeatures, itemfeatures): ... return predict def predict(users, items): # the function fit retu
Probability·Generated at run time
Section 2.8.7 of the book approximates a distribution by drawing $Ns$ samples and treating them as spikes (eq. 2.179). The same idea estimates an expectation by the sample mean, and the central limit theorem (section 2.8.6, eq. 2.178) gives its error: the sample mean is approximately normal around the true value with standard deviation $\sigma / \sqrt{N}$. That rate is the baseline here. Halving the error by brute force takes four times the samples. Here the number of evaluations of $f$ is fixed. Build the estimator of $\mathbb{E}{x \sim p}[f(x)]$ with the lowest error for that budget. Any
Adversarial Robustness·MNIST
Implement generateadversarialexample() that takes a trained model, an input image, its true label, and a perturbation budget epsilon, then returns a perturbed image that (1) fools the model into predicting a different class, (2) stays within epsilon of the original in L∞ norm, and (3) remains in valid pixel range [0,1]. You may use any gradient-based adversarial attack method (FGSM, PGD, etc.).
Neural Network Fundamentals·MNIST
Build a complete neural network from scratch using only NumPy. You must implement forward propagation, backward propagation (backprop), and parameter updates manually. No PyTorch, TensorFlow, or autograd libraries allowed. Implement a simple MLP that achieves ≥85% accuracy on MNIST by manually computing all gradients.
Loss Functions·MNIST
Implement a NumPy-based lossfunction that operates on class probabilities (softmax outputs) and integer class targets, returning both the loss value and the gradient with respect to the probabilities. You may use any differentiable classification loss** you like.
Computer Vision·MNIST
Someone hands you 60,000 handwritten digits and the budget to label 40 of them. Section 19.3 of the book is about exactly this setting: the labelled set is far too small to learn a classifier from, but the unlabelled images show how the data is shaped, and the methods of the section (self-training and pseudo-labels, entropy minimization, label propagation on graphs, consistency regularization, self-supervised pre-training and distillation) all turn that shape into accuracy. Your job is to build the most accurate digit classifier you can from 40 labels. Any method is allowed. The data
Reinforcement Learning·Generated at run time
Estimate how well a target policy would do using only data logged by a different behaviour policy. Every task hides a Markov decision process. You get episodes generated by the behaviour policy b, both policies' action probabilities, the discount, and a set of query states. Return your estimate of the target policy's state value vpi(s) at every query state. The leaderboard ranks by mean normalised RMSE over all tasks, lower is better. Contract.** Define estimate(task) -> sequence of floats with one value per query state, in query order. It is called once per task. task
Machine Learning·Generated at run time
You run the recommender of a simulated video site. Every round a batch of users opens the site, and for each one you choose a short ordered slate of items from the catalog. Users click or do not click. You only ever learn about what you showed: if an item was never on a user's slate, you never find out whether they would have liked it, and everything you train on next round was caused by what you recommended this round. Get as many clicks as you can. Any method is allowed. What you write `python class Recommender: def init(s
Machine Learning·Fashion-MNIST
You get a pile of images and no labels. Draw each image as a single point on a 2-D map, so that points that land close together on the map really are close in the original pixel space, and keep that true whether someone looks at the nearest handful of points or at a whole neighbourhood. The most faithful map wins. What you write - X: float64 array of shape (N, D), one flattened image per row, pixel values in [0, 1], in random order. There are no labels
Reinforcement Learning·Generated at run time
An agent is dropped into a gridworld maze it has never seen. Every time it reaches the goal it earns +1 and is sent back to the start. Partway through the run, without warning, the maze changes: a wall can close the route the agent relies on, or an opening can appear that makes a shorter route possible. Collect as many goals as you can in a fixed number of real steps. The leaderboard ranks by percent of the oracle's goals, higher is better. Contract. Define a class Agent: - Agent(nstates, nactions, totalsteps) is created once per maze. nactions is 4. total_steps is the nu
Computer Vision·Olivetti Faces
Recognise Faces You Have Never Seen A recognition system meets people it was never trained on. Some have just been enrolled with a single photo, and some have never been seen at all. It has to name the first group and refuse to name the second, and it gets one similarity threshold to do both. You train on some people from the Olivetti faces. The grader then holds a matching session with other people, using nothing but your embedding and your threshold. The session's photos were not taken the way your training photos were. What you write `python def train(Xtrain, ytrain): ... #
Regression·Generated at run time
Section 11.4.6 of the book measures a sparse signal of $D = 4096$ coefficients with only $N = 1024$ random linear measurements: 160 spikes, a little noise, and the question of how to get $w^$ back from $y = Xw^ + \epsilon$ when there are four times more unknowns than equations. The minimum-norm solution is hopeless (MSE 0.0292), the lasso finds the spikes but shrinks them (0.0027), and least squares on the lasso's support nails it (3.3e-5) (Figure 11.13). That setting turns out to be easy. Your job is to recover sparse signals in harder ones, as accurately as you can. The instances Ever
Regression·Generated at run time
Section 2.6.3 of the book makes both parameters of a Gaussian depend on the input, $$p(y \mid x; \theta) = \mathcal{N}\left(y \mid f\mu(x; \theta),\ f\sigma(x; \theta)^2\right) \qquad \text{(eq. 2.120)}$$ Fixing the variance gives homoscedastic regression (eq. 2.121). Letting it vary gives heteroskedastic regression, which eq. 2.122 writes for a linear model, with the softplus function of eq. 2.123 keeping $\sigma$ positive. Section 2.7.1 then warns that the Gaussian is sensitive to outliers (Fig. 2.16). Here both problems arrive together. Every task has its own hidden mean and its own hi
Statistics·Generated at run time
Sections 4.6.6 and 4.7.4 of the book give two ways to put an interval around an unknown quantity: a Bayesian credible interval, which holds $1-\alpha$ of the posterior mass, and a frequentist confidence interval, which covers the true value in $1-\alpha$ of repeated datasets. Section 4.7.5 shows how the textbook Wald interval $\hat\theta \pm z_{\alpha/2}\,\widehat{\mathrm{se}}$ (eq. 4.227) goes wrong with small samples and near a boundary: one Bernoulli trial with $y = 0$ gives the interval $(0, 0)$. Here your intervals are judged on outcomes. The grader draws thousands of small datas
Model Architecture·Generated at run time
Build and train a small convolutional neural network to classify tiny synthetic images into two pattern classes (horizontal vs vertical stripes). What you implement 1. buildmodel(imgsize=8, nclasses=2) Return a torch.nn.Module CNN with at least: Conv2d -> ReLU -> pool -> Linear (you may add a second conv block). Input images are single-channel (N, 1, imgsize, imgsize). 2. trainmodel(model, trainx, trainy, epochs=15, lr=0.01, batchsize=32, seed=0)** Train model in place on the provided tensors with a standard classi