Linear Regression and Softmax Regression Implementation Guide

Linear Regression Fundamentals The linear model is defined as: $y = Xw + b + \epsilon$, where $w$ represents weights and $b$ is the bias term. Model evaluation relies on loss functions that quantify prediction errors: MSE Loss Function: $$ l^{(i)}(w,b) = \frac{1}{2}(\hat{y}^{(i)} - y^{(i)})^2 \ L(w,b) = \frac{1}{n}\sum_{i=1}^{n}l^{(i)}(w,b) $$ ...

Posted on Wed, 08 Jul 2026 17:00:30 +0000 by Jackomo0815

Fundamentals of Deep Learning

PyTorch Model Training Demo Code In PyTorch, model training typically involves several key steps: defining the model, defining the loss function, selecting an optimizer, preparing a data loader, and writing the training loop. Below is a simple PyTorch model training demo code that implements a basic neural network for handwritten digit recognit ...

Posted on Mon, 06 Jul 2026 16:54:45 +0000 by nokicky

YOLOv9: A Comprehensive Guide to Setup, Training, and Inference

YOLOv9 represents a significant advancement in real-time object detection, distinguished by its innovative use of a purely convolutional architecture. Unlike many contemporary models that integrate Transformer layers, YOLOv9 achieves state-of-the-art performance, reportedly surpassing models like RT-DETR and even YOLOv8 across various benchmark ...

Posted on Sun, 05 Jul 2026 17:20:05 +0000 by mustng66

Introduction to PyTorch Framework // Optimizing Convolution Operations with AVX // Essential GDB Debugging Techniques

PyTorch is a tensor library optimized for deep learning that leverages both GPU and CPU capabilities Chinese documentation: https://pytorch.org/resources Gradient and Derivative Calculation # gradient_calculation.py import torch import numpy as np input_val = torch.tensor(3.) weight = torch.tensor(4., requires_grad=True) bias = torch.tensor(5 ...

Posted on Sat, 04 Jul 2026 17:50:31 +0000 by zoozoo

PyTorch Tensor Operations and Deep Learning Fundamentals

Tensor Objects and Operaitons A Tensor represents a multi-dimensional matrix where all elements must share the same data type. PyTorch supports floating-point, signed integer, and unsigned integer types, which can reside on either CPU or GPU devices. The dtype attribute specifies the data type, while device determines the hardware location. imp ...

Posted on Sat, 04 Jul 2026 16:18:14 +0000 by Lphp

Deconstructing the Transformer Architecture: A Component-Level Implementation Guide

Input Tensor Configuration and Data Pipeline Sequence-to-sequence translation systems operate by mapping discrete token indices from a source vocabulary to a target vocabulary. For implementation purposes, consider a source lexicon containing 2,000 tokens and a target lexicon with 1,000 tokens. Training occurs in batches, typically formatted as ...

Posted on Thu, 02 Jul 2026 16:19:48 +0000 by wmvdwerf

VGG16: A Deep Convolutional Neural Network for Image Recognition

VGG16 Theory Advantages of VGG16 VGG16, proposed by Simonyan and Zisserman, introduced several key innovations: Small Convolutional Kernels: It primarily uses 3x3 convolutional kernels instead of larger ones like 7x7. This approach offers two main benefits: It reduces the number of parameters in the model. It increases the model's non-lineari ...

Posted on Thu, 02 Jul 2026 16:10:49 +0000 by nick1

Essential PyTorch Code Snippets for Deep Learning

Tensor Creaiton and Initialization Basic Tensor Operations import torch # Create tensor from list data_tensor = torch.tensor([1, 2, 3], dtype=torch.float32) # Create tensor with random values (uniform distribution) rand_tensor = torch.rand(2, 3) # Create tensor with normal distribution values normal_tensor = torch.randn(3, 4) # Create tenso ...

Posted on Wed, 01 Jul 2026 17:53:53 +0000 by blintas

Implementing Automatic Mixed Precision Training in PyTorch

PyTorch's Automatic Mixed Precision (AMP) feature allows efficient training by combining FP32 and FP16 precision operations. This technique reduces memory usage and accelerates computation while maintaining model accuracy. Understanding Mixed Precision Deep learning models traditionally use 32-bit floating point (FP32) for all operations. Mixed ...

Posted on Wed, 01 Jul 2026 16:52:27 +0000 by Miker

PyTorch Embedding Layer Mechanics and Linear Layer Differences

Lookup Table Mechanics In neural networks for sequence processing, the nn.Embedding module functions as a searchable dictionary. It translates discrete integer identifiers into continuous high-dimensional vectors. Rather than requiring sparse one-hot representations as inputs, this layer dircetly accepts integer indices to retrieve their corres ...

Posted on Sun, 28 Jun 2026 18:02:56 +0000 by Sander