Skip to main content

Posts

Showing posts with the label feature extraction

SVD and Truncated SVD Explained: Theory, Python Examples, and Applications in Machine Learning & Deep Learning

Singular Value Decomposition (SVD) is a matrix factorization method widely used in mathematics, engineering, and economics. Since it's a crucial concept applied in accelerating matrix computations and data compression, it's worth studying at least once. SVD (Singular Value Decomposition) Theory Singular Value Decomposition (SVD) is a matrix factorization technique applicable to any real or complex matrix. Any matrix  A (m×n)  can be decomposed as follows: $A = U * \Sigma * V^T$ U : Orthogonal matrix composed of left singular vectors $(m \times m)$ Σ : Diagonal matrix $(m \times n)$ with singular values on the diagonal $V^T$ : Transposed matrix of right singular vectors $(n \times n)$ The singular values represent the energy or information content of matrix A, enabling tasks like dimensionality reduction or noise filtering. Truncated SVD Truncated SVD approximates the original matrix using only the top  k  singular values and corresponding singular vectors: $A \approx...

Convolution Operator and Layer Explained in Deep Learning

  What is a Convolution Layer in Deep Learning? A  convolution layer  is a building block of Convolutional Neural Networks (CNNs). It's mostly used to process  image data . Instead of connecting every pixel of the input to every neuron (as in a fully connected layer), a convolution layer  slides a small filter (kernel)  across the image and  extracts features  like edges, textures, or patterns. Key Terms Input : The image or feature map (e.g., 6x6 pixels). Kernel(Filter) : A small matrix (e.g., 3x3 or 5x5) that moves across the image. Stride : How many steps the filter moves at a time. Padding : Adding extra pixels around the image to control the output size. Feature Map : The result of the convolution operation. How Convolution Works Let’s walk through an example with  no padding  and  stride = 1 . 1. Input: 6x6 Matrix Input: [ [9, 4, 1, 6, 5], [1, 1, 1, 0, 2], [1, 2, 1, 1, 3], [2, 1, 0, 3, 0], [1, 4, 2, 5, 6] ] 2. Kernel: ...