PinnedInData Science CollectivebyWei Yi·Oct 3, 2025Neural network gradients, chain rule and PyTorch forward/backwardThis article explains how to use the chain rule to compute neural network gradients and how to implement forward and backward in PyTorchA response icon1A response icon1
PinnedInData Science CollectivebyWei Yi·May 26, 2025Reinforcement Learning from Human Feedback (RLHF) — Models, Losses and their explanationsThis article introduces the four models used in RLHF, how they are setup, their loss and gradient derivations, and their intuitionsA response icon2A response icon2
PinnedInTDS ArchivebyWei Yi·Jun 1, 2024How Does an Image-Text Multimodal Foundation Model WorkLearn how an image-text multi-modality model can perform image classification, image retrieval, and image captioningA response icon4A response icon4
PinnedInTDS ArchivebyWei Yi·May 14, 2024How Does the Segment-Anything Model’s (SAM’s) Encoder Work?a deep dive into how image content embedding, sine and cosine positional embedding, guidance click embedding and dense mask embedding is…A response icon1A response icon1
PinnedInTDS ArchivebyWei Yi·Mar 24, 2024How does the Segment-Anything Model’s (SAM’s) decoder work?A deep dive into how the Segment-Anything model’s decoding procedure, with a focus on how its self-attention and cross-attention mechanism…A response icon1A response icon1
InAI AdvancesbyWei Yi·Aug 15Understanding Alphafold 1, all the essentials for computer scientistsRecently, Google DeepMind reportedly decided to dismantle the AlphaFold team. I have long admired the AlphaFold series — AlphaFold 1…A response icon3A response icon3
InTDS ArchivebyWei Yi·Jul 24, 2024Understand REINFORCE, Actor-Critic and PPO in one goUse the loss function of the Policy Gradient algorithm to understand REINFORCE, Actor-Critic, and Proximal Policy Optimization (PPO).
InTDS ArchivebyWei Yi·Jun 4, 2023Speeding up vision transformer prediction by 9 times faster with PyTorch, ONNX and TensorRTHow to use 16bit float, TensorRT, network rewriting and multi-threading to dramatically speed up deep learning model prediction
InTDS ArchivebyWei Yi·May 15, 2023How Decision Trees Split Nodes, from Loss Function PerspectiveLearn how a decision tree splits nodes only to minimize its loss functionA response icon2A response icon2