Rico's Nerd Cluster

「离开世界之前 一切都是过程」

Deep Learning - Grad-CAM

A Step-by-Step Example with a Tiny Neural Network

Grad-CAM (Gradient-weighted Class Activation Mapping) is a technique for understanding which spatial regions of an image contribute to a neural network’s classification. Suppose we train a neural n...

Deep Learning - Integrated Gradients

A Step-by-Step Example with a Tiny Neural Network

Integrated Gradients (IG) explains a neural network’s prediction by estimating how much each input feature contributes to a score relative to a chosen baseline input. For an image classifier, it an...

Deep Learning - Learning Rate Schedules

Warmup, LambdaLR, Cosine Decay, Cosine Annealing, SGDR

Consider gradient descent: \[\theta_{t+1}=\theta_t-\eta_t\nabla L(\theta_t)\] Where: θ_t: model parameters at step t η_t: learning rate at step t ∇L: gradient of the loss Warmup Warmup...

Deep Learning - Truncated Normal Distribution

Rejection Sampling, trunc_normal_, ViT Positional Embedding Initialization

A truncated normal distribution is a normal distribution restricted to an interval [a, b]: values outside it are never produced. 1. Rejection Sampling Example Suppose we draw these eight values f...

Deep Learning - Why 100 GB of NumPy Data Slowed Down Our ML Training

NumPy Memory Mapping, Linux Page Cache, Swap, Pause and Resume, and Ragged Arrays

1. The Problem Suppose we’re training a 3D LiDAR object recognition model to detect cars, pedestrians, and cyclists. We have three training configurations: centred crops, shifted crops, and tempor...

Deep Learning - Contrastive Learning

Supervised Contrastive Learning (SupCon)

Supervised contrastive learning (SupCon) trains a model to produce embeddings in which images of the same class are close together and images of different classes are far apart. Ordinary classifica...

Deep Learning - Flash Attention

IO-Aware Attention, Tiling, Online Softmax

What FlashAttention Does FlashAttention computes exact attention without storing the huge \(N\times N\) attention matrix: \[\operatorname{Attention}(Q,K,V) = \operatorname{softmax}\left(\frac{QK^...

Deep Learning - Transformer Series 6 - Decoder-Only LLMs and KV Cache

Next-Token Training, Causal Mask, LM Head, KV Cache

How a Decoder-Only LLM Is Trained Suppose we want to train a model to answer questions. Consider this training example: 1 [BOS] [USER] What do you see ? [ASSISTANT] I see a robot Here, [BOS] is...

Robotics - [Jetson 2] Running the Orin: Power Modes, Benchmarking, and Pitfalls

Power modes, sustained performance, memory reporting, Wifi, and how I burned a board

This is part 2 of my Jetson notes. Part 1, Flashing the Orin Nano, covers getting JetPack onto the board. I Burned My $500 Nvidia-nano-orin This happened when I connected it to a Waveshare Rover ...

[ML] Neural Architecture Search (NAS) in RF DETR

The main idea of the NAS RF-DETR is different resolutions do produce different size tensors and therefore different sized computation graphs, but they can still use the same learned weights. Traini...