Перейти к содержимому

Matrix Multiplication Backward in JavaScript | Make Your Own PyTorch #26

Byte यंत्र

0:00 / 0:00

Matrix Multiplication Backward in JavaScript | Make Your Own PyTorch #26

5 просмотров · 11 дн. назад
Byte यंत्र
3 подписчика
5 просмотров · 11 дн. назад
How does Autograd calculate gradients for matrix multiplication? 🤔 In Episode 26 of Make Your Own PyTorch, we implement the backward pass for matrix multiplication and understand how gradients flow back to both input tensors. In the forward pass, we compute the matrix product: C = A @ B But during backpropagation, we need to calculate the gradients for both A and B. Let's understand the mathematics behind these gradients and translate the rules into code for our JavaScript-based Tensor library. In this video, you'll learn: How matrix multiplication works in the forward pass Why backward implementation needs gradients for both input matrices How to derive the gradient with respect to A How to derive the gradient with respect to B Why transposed matrices appear in the gradient formulas How the chain rule applies to matrix multiplication How to implement matrix multiplication backward in our Autograd engine How to verify gradient shapes and calculations This is Episode 26 of Make Your Own PyTorch, a series where we build a PyTorch-like Tensor library from scratch using JavaScript and explore the internals of tensors, operations, and automatic differentiation. We're building our own Autograd engine step by step, understanding the mathematics before relying on the framework. #MatrixMultiplication #Autograd #BackwardPass #PyTorch #AutomaticDifferentiation #Backpropagation #Gradients #TensorOperations #JavaScript #MachineLearning #DeepLearning #PyTorchFromScratch #CodingInHindi #ProgrammingInHindi #MakeYourOwnPyTorch