All puzzles › Deep Learning
Deep Learning Practice Problems
27 puzzles (12 easy, 12 medium, 3 hard), 7 free, in Python, JavaScript and C++.
Activations, layers, convolutions and the building blocks of neural nets.
The puzzles, easiest first
- A Mask in a Handful of Numbers (Easy, free): A segmentation mask marks which pixels belong to an object, and it is mostly long runs of the same value.
- How Far Back It Can See (Easy, free): Each layer of a convolutional network sees a little further than the one below it.
- Shorter, Same Direction (Easy, free): One bad batch can produce a gradient so large that a single step wrecks the model.
- Squeeze the Stutter Out (Easy, free): A speech model outputs one symbol for every sliver of audio, so a single letter comes out many times in a row, with a special blank symbol in the gaps.
- Apply Dropout Mask (Easy): Given a list of activations and a mask of 0s and 1s, return the activations with every masked-out spot set to 0.
- Argmax (Predicted Class) (Easy): Given a list of numbers, return the INDEX of the biggest one, not the value.
- Embedding Lookup (Easy): Given an embedding table with one row per token, and a list of token IDs, return the row for each ID, in order.
- Flatten Feature Map (Easy): Given a 2D grid, return all its values in one flat array, row by row.
- Leaky ReLU (Easy): Given a list of numbers, apply Leaky ReLU to each one.
- ReLU Activation (Easy): Given a list of numbers, apply ReLU to each one and return the results.
- Sigmoid (Easy): Given a number x, return the sigmoid of x, rounded to 4 decimals.
- Tanh Activation (Easy): Given a list of numbers, apply tanh to each one, rounded to 4 decimals.
- Cut the Picture Into Words (Medium, free): A vision transformer reads an image the way a language model reads a sentence, so the image first has to become a sequence.
- Cut the Weakest Weights (Medium, free): Most of a trained network's weights are close to zero and can be removed with little harm.
- 1D Convolution (Medium): Given a signal and a smaller kernel, slide the kernel along the signal and return the weighted sum at each spot where it fully fits, rounded to 3 decimals.
- Batch Normalization (Medium): Given a batch of numbers, normalize them to a mean of 0 and a spread of 1, rounded to 3 decimals.
- Count Parameters (Medium): Given the number of neurons in each layer, return the total trainable parameters.
- Cross-Entropy Loss (Medium): Given a list of predicted probabilities and the index of the true class, return the cross-entropy loss, rounded to 4 decimals.
- Dense Layer Forward (Medium): Given a weight matrix, a bias vector, and an input vector, return the layer's outputs, rounded to 3 decimals.
- GELU Activation (Medium): Given a list of numbers, apply the GELU activation to each one and return the results, rounded to 4 decimals.
- Max Pooling (1D) (Medium): Given a list of numbers and a window size, split the list into chunks of that size, with no overlap, and return the biggest value in each chunk.
- Mean Pooling (1D) (Medium): Given a list of numbers and a window size, split the list into chunks of that size, with no overlap, and return the average of each chunk, rounded to 3 decimals.
- MSE Gradient (Medium): Given predictions and targets, return the gradient of the mean squared error for each prediction, rounded to 3 decimals.
- Softmax (Medium): Given a list of scores, turn them into probabilities that add up to 1, rounded to 4 decimals.
- One Box per Object (Hard, free): A detector proposes many overlapping boxes for the same object, and non-maximum suppression keeps the best one.
- 2D Convolution (Hard): Given an image and a smaller kernel, both as 2D grids, slide the kernel over every spot where it fully fits and return the grid of weighted sums, rounded to 3 decimals.
- Attention Weights (Hard): Given a query vector and a list of key vectors, return the attention weights, rounded to 4 decimals.
Practice another pattern
Or browse by subject
Browse all 676 puzzles