Implementing Vision Transformers for Image Classification
Understanding Vision Transformers for Image Classification
The Vision Transformer (ViT) represents a groundbreaking approach that merges principles from natural language processing with computer vision. This architecture leverages self-attention mechanisms to achieve impressive results in image classification tasks without relying on traditiona ...
Posted on Thu, 06 Aug 2026 16:38:07 +0000 by jola
Two Approaches for Plotting Loss Curves in Caffe
Introduction
When training deep learning models with Caffe, visualizing the training progress through loss curves is essential for monitoring model convergence. This article presents two practical approaches for generating training visualizations.
Method 1: Custom Python Script for Headless Servers
The following implementation is specifically d ...
Posted on Fri, 31 Jul 2026 16:19:59 +0000 by goldilok
Common TensorFlow 2.x Migration Errors and Fixes
When migrating legacy TensorFlow 1.x code to TensorFlow 2.x, several common attribute errors may occur due to API changes. Below are typical issues and their solutions:
1. module 'tensorflow' has no attribute 'placeholder'
tf.placeholder was removed in TensorFlow 2.x. To retain 1.x behavior:
import tensorflow.compat.v1 as tf
tf.disable_v2_behav ...
Posted on Thu, 30 Jul 2026 16:47:00 +0000 by laurus
PyTorch GPU CUDA Usage and Common Error Solutions
1.1 Approach 1: Using os.environ['CUDA_VISIBLE_DEVICES']
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '2'
model = NeuralNet().cuda()
batch = batch.cuda()
1.2 Approach 2: Using torch.device()
target_device = torch.device('cuda:2')
model = NeuralNet().to(target_device)
batch = batch.to(target_device)
1.3 Errer 1: RuntimeError: CUDA error: inv ...
Posted on Thu, 23 Jul 2026 16:16:24 +0000 by timgetback
Image Augmentation Techniques for Deep Learning Datasets
Color adjustment (brightness, saturation, contrast)
Random scaling
Random cropping
PCA-based color augmentation
Translation shifting
Horizontal/vertical flipping
Rotation and affine transformations
Gaussian noise additoin
Class imbalance correction
Implementation Example (NumPy/PIL)
from PIL import Image, ImageEnhance
import numpy as np
impo ...
Posted on Wed, 15 Jul 2026 16:32:53 +0000 by gareh
Predicting Chemical Reaction Yield Using Recurrent Neural Networks on SMILES Strings
Chemical Informatics Fundamentals
The evolution of artificial intelligence in chemistry involves several stages. Early efforts focused on digitizing chemical knowledge into databases using various representation methods. Mid-stage approaches relied on manual feature engineering to encode existing data, followed by traditional machine learning a ...
Posted on Sat, 11 Jul 2026 16:37:55 +0000 by jdpatrick
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
Deep Learning Environment Setup and Project Configuration
Version Checking
# Check CUDA version (Command Prompt)
nvcc -V or nvcc --version
# Check Python version (Command Prompt)
python
# Check available CUDA versions (Command Prompt)
nvidia-smi # CUDA Version is displayed after this text
Installation Process
1. Visual Studio Installation
Version Selection: For CUDA 11.8.0 (can be higher th ...
Posted on Mon, 08 Jun 2026 17:32:29 +0000 by warren
Understanding Convolution in Deep Learning: From Mathematics to Implementation
Convolution is a foundational operation in deep learning—especially in computer vision—where it enables hierarchical feature extraction through localized, parameter-shared transformations. Unlike general matrix multiplication, convolution exploits spatial locality and translation invariance, making it both computationally efficient and semantic ...
Posted on Mon, 08 Jun 2026 16:24:13 +0000 by puja