<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hion</title>
    <description>The latest articles on DEV Community by Hion (@hion).</description>
    <link>https://dev.to/hion</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4041189%2Fd3f824e9-5eea-45f4-abb5-8068768e6fe0.png</url>
      <title>DEV Community: Hion</title>
      <link>https://dev.to/hion</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hion"/>
    <language>en</language>
    <item>
      <title>My Key Takeaways After Reading "Deep Learning on Graphs": Graph Neural Networks</title>
      <dc:creator>Hion</dc:creator>
      <pubDate>Fri, 21 Aug 2026 13:56:51 +0000</pubDate>
      <link>https://dev.to/hion/my-key-takeaways-after-reading-deep-learning-on-graphs-graph-neural-networks-3b8k</link>
      <guid>https://dev.to/hion/my-key-takeaways-after-reading-deep-learning-on-graphs-graph-neural-networks-3b8k</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Graph Neural Networks (GNNs) apply deep neural network concepts directly to graph structures. In traditional graph embeddings, one vector holds static information. In GNNs, a vector acts like a &lt;strong&gt;dynamic vector&lt;/strong&gt; — much like comparing a static array to a dynamic array—creating a supervector that contains its own data plus its neighbors' data. Adding non-linear activation functions (like ReLU) allows this dynamic vector trajectory to become flexible.&lt;/p&gt;

&lt;p&gt;From a linear perspective:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Vector Addition&lt;/strong&gt;: Adding two vectors connects the head of one to the tail of another, producing a resulting vector that completes the missing side of a triangle—this is how vectors bundle information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Matrix Multiplication&lt;/strong&gt;: Represents a sequence of linear transformations that shifts the coordinate system from right to left, streamlining data and discarding unused information.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GNNs preserve the original graph topology to maintain variety, breaking the rigid matrix rules where every item must have a fixed number of neighbors (like pixels in an image having exactly 8 neighbors).&lt;/p&gt;

&lt;h2&gt;
  
  
  Core GNN Tasks
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Node-Focused Tasks (Node Classification)&lt;/strong&gt;: Focuses on individual objects, including identifying fraud accounts, or recommender shopping systems. It combines multiple pieces of information into single vectors to group nodes into specific areas for prediction. The total number of vectors stays unchanged—only the vector dimensions change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Graph-Focus Tasks (Graph Classification)&lt;/strong&gt;: Focuses on global structure, such as analyzing molecular properties (CH2, CH4) or detecting malicious code sequences. It works like node-focus but adds a pooling step at the end to condense everything into a single vector inheriting all features.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GNNs can be accessed from two perspectives: &lt;strong&gt;Spectral-based&lt;/strong&gt; (algebraic) and &lt;strong&gt;Spatial-based&lt;/strong&gt; (geometric).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Spectral-based Graph Filters&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This matrix method subtracts the degree matrix from the adjacency matrix (the Graph Laplacian), where diagonal entries are zero and non-neighbor values are negative, measuring vector interactions through wave oscillations.&lt;/p&gt;

&lt;p&gt;Direct spatial convolutional on irregular graph topologies is mathematically challenging. Spectral filtering addresses this by transforming graph signals into the frequency domain via Graph Fourier Transform. In the frequency domain, complex convolutions convert into straightforward matrix multiplications. Once filtered, the signals are transformed back to the original spatial domain.&lt;/p&gt;

&lt;p&gt;Converting graph data to a spectral space and back serves a clear purpose: human do not know how to draw wave oscillations, so deep learning converts the signal to adjust parameters (

&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;λ&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
) in that transformed space until it finds the optimal result.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Chebyshev Polynomials &amp;amp; Cheby-Filter&lt;/strong&gt;: Instead of giving the model a pen and letting it draw freely without instruction, Cheby-Filter hands the model a function—a ruler or geometric tool—so it draws structured shapes without overthinking. Using dynamic programming, level k inherits results from level k-1. Inputs shrink to the range [-1, 1] to save computational energy and prevent exploding values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GCN-Filter&lt;/strong&gt;: An upgraded, simplified Cheby-Filter. Instead of using complex curved rulers, circles, or triangles, GCN uses simple horizontal or cross lines to model wave oscillations. It assumes a maximum eigenvalue of $2$ to make calculations lighter, focusing purely on immediate 1-hop neighbors.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Spatial-based Graph Filters&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Spatial filters operate directly in coordinate space using vector addition to combine information and matrix multiplication to filter it, making node updates much easier to implement.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Early Graph Filters&lt;/strong&gt;: Used rigid, fixed calculation functions, making the model robot-like and lacking adaptability&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GraphSAGE-Filter&lt;/strong&gt;: Randomly picks a subset of neighboring nodes and zips their information. It uses clever tricks, priorizing nodes with high weights/degrees or running random walks to pick representative neighborhood nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GAT-Filter&lt;/strong&gt;: While GCN treats all graph structures uniformly, GAT evaluates specific nodes. Like a talent contest, neighbor nodes that fit better receive higher scores. GAT even employs multiple juges (multi-head attention) to rank neighbors from different perspectives.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ECC-Filter (Edge-Conditioned Convolution)&lt;/strong&gt;: Uses edge features to produce transformations for nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mo-Filter&lt;/strong&gt;: Introduces pseudo-coordinates to make graph geometry flexible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;MPNN (Message Passing Neural Network)&lt;/strong&gt;: A General Serves as the overarching general framework summarizing all spatial filters.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Graph Pooling&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Graph pooling shrinks all node vectors into a single graph-level vector (summarizing both feature of nodes and structure of graph). Because one vector must absorb massive amounts of data, information loss is a risk. Therefore, Hierarchical Graph Pooling is the solution to this problem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Hierarchical Graph Pooling&lt;/strong&gt;: Similar to the Chuliu-Edmond algorithm for finding minimum spanning trees (with its contracting and expanding phases), this approach avoids collapsing everything at once. It condenses the graph step-by-step from local components to larger structures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Parameter Learning for Graph Neural Networks&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Parameter Learning for Node Classification: Makes individual nodes smarter by training decision boundaries in localized classification areas.&lt;/li&gt;
&lt;li&gt; Parameter Learning for Graph Classification: Verifies whether global graph structures convey accurate collective information.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;After-learning notes: The Laplacian matrix link back to Pierre-Simon Laplace and the concept of &lt;em&gt;Laplace's Demon&lt;/em&gt; - a theoretical entity capable of predicting the future by calculating physical state data. Modern GNNs reflect a similar goal: by learning from past graph topologies, models predict future user purchase desires or gold price trends, almost as if attempting to recreate that demon.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>computerscience</category>
      <category>deeplearning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>My Key Takeaways After Reading "Deep Learning on Graphs": Graph Embedding</title>
      <dc:creator>Hion</dc:creator>
      <pubDate>Wed, 19 Aug 2026 14:06:35 +0000</pubDate>
      <link>https://dev.to/hion/my-key-takeaways-after-reading-deep-learning-on-graphs-graph-embedding-1idi</link>
      <guid>https://dev.to/hion/my-key-takeaways-after-reading-deep-learning-on-graphs-graph-embedding-1idi</guid>
      <description>&lt;p&gt;&lt;strong&gt;Graph embedding&lt;/strong&gt; is simply how we map a graph's nodes into vector in a continuous coordinate space.&lt;/p&gt;

&lt;p&gt;From a linear algebra perspective, an adjacency matrix A represents the graph's connections and edge weights. Our goal is to transform each node into a d-dimensional vector in a lower-dimensional coordinate system. The edges represent relationships between vectors, which we measure using the &lt;strong&gt;dot product&lt;/strong&gt;. If two vectors point in the same direction (dot product close to 1), they are highly similar or strongly connected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Random Walk &amp;amp; DeepWalk&lt;/strong&gt;&lt;br&gt;
A random walk is a graph traversal algorithm, similar in spirit to BFS and DFS, but without strict deterministic rules.&lt;/p&gt;

&lt;p&gt;To visualize a Random Walk, imagine placing an ant on a node. The ant walks randomly from node to node, recording its travel path. By analyzing these paths, we discover which nodes frequently show up together (co-occurrence). We then update out vector space to pull these co-occurring nodes closer so their vectors point in similar directions. This entire process forms the foundation of &lt;strong&gt;DeepWalk&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Why use Random Walks instead of traditional DFS or BFS?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Parallel Processing&lt;/strong&gt;: DFS and BFS are linear and constraint-heavy, you can only process one path at time with a single "ant". Random Walks, however, allow us to release 1,000 ants simultaneously to explore different parts of the graph in parallel, making training significantly faster. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Capturing Community&lt;/strong&gt;: Random walks better reveal structural contexts and local communities.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since an ant could theoretically walk endlessly across the entire graph, we use a &lt;strong&gt;context window&lt;/strong&gt; restricts the ant's view to just 1 or 2 steps ahead, focusing specifically on highly localized node relationships.&lt;/p&gt;

&lt;p&gt;After each walk, a reconstruction function updates the relations among nodes. Updating incrementally after each walk, rather than waiting to process the while graph at once, keeps the coordinate system stable and prevents vectors from over-fitting to just a few neighbors. However, calculating dot product between one node and billions of other is computationally impossible. To solve this, we rely on divide-and-conquer strategies and tree structures to accelerate the learning process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hierarchical Softmax&lt;/strong&gt;&lt;br&gt;
Hierarchical Softmax uses a binary tree structure to group similar nodes on the same branch. The closer a node is to the root, the boarder its category.&lt;/p&gt;

&lt;p&gt;Think of it like a university: the root represents the university itself, the next layer branches into specific majors (e.g., Computer Science), and deeper layers descend into specialized courses for that major. By using this divine-and-conquer tree structure, the model can inherit prior node decisions and dramatically speed up vector calculations from 

&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;O&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;N&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 to 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;O&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mop"&gt;lo&lt;span&gt;g&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;N&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Negative Sampling&lt;/strong&gt;&lt;br&gt;
Negative Sampling works like a gacha game with a clever cheat.&lt;/p&gt;

&lt;p&gt;When updating a target node, calculating its relationship against all other nodes in a massive graph is unrealistic. Instead of evaluating everything, the algorithm picks the 1 actual neighbor (the rare "5-star" positive pull) to draw closer, and randomly samples a few unrelated nodes (the common "1-star" negative pulls) to push far away in the vector space. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node2Vec&lt;/strong&gt;&lt;br&gt;
Technology is never stop evolving, and &lt;strong&gt;Node2Vec&lt;/strong&gt; is the upgrade version of DeepWalk.&lt;/p&gt;

&lt;p&gt;While Deepwalk relies on purely uniform random walks, Node2Vec introduces two parameters, &lt;strong&gt;p&lt;/strong&gt; and &lt;strong&gt;q&lt;/strong&gt;, to control the ant's walking behavior:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Return Parameter&lt;/strong&gt; (p): A small p encourages the ant to stay close to the starting node (like a localized BFS search), capturing tight-knit &lt;strong&gt;communities&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In-out Parameter&lt;/strong&gt; (q): A small q encourages the ants to explore outward into new regions (like a deep DFS search), capturing &lt;strong&gt;structural roles&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;LINE&lt;/strong&gt;&lt;br&gt;
Rather than relying solely on linear paths, &lt;strong&gt;LINE&lt;/strong&gt; explicity models two structural perspective:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First order Proximity: Direct connections between nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second-order Proximity: Shared neighborhood contexts. Even if two nodes do not have a direct adge between them, if they share almost identical context vectors (similar neighbors), LINE pulls their embeddings closer together.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Struct2Vec&lt;/strong&gt;&lt;br&gt;
Struct2Vec builds upon LINE's ideas, Relying only on immediate neighbors can lead to mistakes when identifying global roles. Struc2vec expands this scope by recursively evaluating the neighborhood structure of a node's neighbors. Nodes with similar structural roles (e.g., "hubs" or "leaf nodes") are mapped close together in the vector space, even if they are located on opposite sides of the graph.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>datascience</category>
      <category>deeplearning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>My Key Takeaways After Reading "Deep Learning on Graphs": Deep Learning Fundamentals</title>
      <dc:creator>Hion</dc:creator>
      <pubDate>Tue, 18 Aug 2026 17:59:24 +0000</pubDate>
      <link>https://dev.to/hion/my-key-takeaways-after-reading-learning-on-graphs-deep-learning-fundamentals-f91</link>
      <guid>https://dev.to/hion/my-key-takeaways-after-reading-learning-on-graphs-deep-learning-fundamentals-f91</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Feedforward neural networks (FNNs)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A Feedforward Neural Networks (or Multilayer Perceptrons - MLP) maps an input vector x to an expected output vector y.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Architecture&lt;/strong&gt;&lt;br&gt;
From a graph theory perspective, an FNN can be viewed as a multi-layer Directed Acrylic Graph (DAG). Between any two adjacent layers, the nodes from a &lt;strong&gt;complete bipartite graph&lt;/strong&gt;, where every neuron in one layer connects to every neuron in the next. The number of vertices (dimensions) does not need to be constant across layers.&lt;/p&gt;

&lt;p&gt;Linear algebraically, mapping x to y is a sequence of &lt;strong&gt;vector space transformations&lt;/strong&gt;, where parameter matrices (W) and bias vector (b) shift and rotate vectors across different dimensions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Activation Functions&lt;/strong&gt;&lt;br&gt;
Activation functions introduce &lt;strong&gt;non-linearity&lt;/strong&gt; into the network, enabling it to learn complex non-linear mapping functions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;ReLU (Rectified Linear Unit)&lt;/strong&gt;: Defined as f(x) = max(0, x). It sets negative values to zero. While simple and efficient, its main drawback is the "Dying ReLU" problem, where neurons getting negative inputs constantly output zero and cease learning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhvk2efypmi7g1eanzzg0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhvk2efypmi7g1eanzzg0.png" alt=" " width="566" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LeakyReLU&lt;/strong&gt;: Solve the dying ReLU problem by multiplying negative inputs by a small constant factor (e.g., 0,01), allowing a small gradient to flow back.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ELU (Exponential Linear Unit)&lt;/strong&gt;: Uses an exponential curve for negative values (

&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;f&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;=&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;α&lt;/span&gt;&lt;span class="mopen"&gt;(&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;e&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;x&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;span class="mclose"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 for 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
). This creates a smoother transition around zero compared to LeakyReLU, though it requires slightly more computational overhead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sigmoid&lt;/strong&gt;: Maps values into the range (0, 1). It is commonly used in the final layer for binary classification or  usually use to evaluate the result in the last layer for binary classification or probability estimation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tanh&lt;/strong&gt;: Maps values into the range (-1, 1). Zero-centered, but suffers from vanishing gradients for extreme values.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjglamtdulhd77bq46pmg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjglamtdulhd77bq46pmg.png" alt=" " width="692" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Output layer and Loss Function&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Output Layer&lt;/strong&gt;: Designed based on the target task (e.g., continuous outputs for regression, Softmax probabilities for multi-class classification).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Loss Function&lt;/strong&gt;: Measures how far prediction deviate from the ground truth, guiding optimization (e.g., Mean Squared Error for regression, Cross-Entropy Loss for classification).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Convolutional neural networks (CNNs)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;CNNs are inspired by the human visual cortex and excel at processing grid-structured data like images.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Convolution Operation&lt;/strong&gt;&lt;br&gt;
Convolutional acts as a feature extraction process. A small matrix (kernel/filter) slides across the input pixels to detect local patterns such an edges, color transitions, and basic contours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Convolutional Layer&lt;/strong&gt;&lt;br&gt;
Instead of dense connections, a convolutional layer employs parallel filters with specific key properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sparse connection&lt;/strong&gt;: Each neuron only connects to a small local region of the input (receptive field), drastically reducing parameter counts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sharing parameter&lt;/strong&gt;: The same filter weights are reused across the entire input grid, making feature detection position-independent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Equivariant Representation&lt;/strong&gt;: If an object in the input shifts position, its feature representation in the output shifts by the exact same amount.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Convolutional layer in practice&lt;/strong&gt;&lt;br&gt;
By stacking multiple convolutional layers, the network learns hierarchical representations: early layers detect low-level features (edges, textures), while deeper layers combine into high-level concepts (shape, visual objects).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Pooling Layer&lt;/strong&gt;&lt;br&gt;
Pooling layers downsample feature maps (via Max Pooling or Average Pooling) to reduce spatial dimensions and computational load while introducing local translation invariance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Overall CNN Framework&lt;/strong&gt;&lt;br&gt;

&lt;/p&gt;
&lt;div class="katex-element"&gt;
  &lt;span class="katex-display"&gt;&lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Input&amp;nbsp;Image&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;⟶&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mopen"&gt;[&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Conv&amp;nbsp;Layer&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;→&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Activation&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;→&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Pooling&lt;/span&gt;&lt;/span&gt;&lt;span class="mclose"&gt;]&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;×&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;N&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;⟶&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Flatten&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;⟶&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Fully&amp;nbsp;Connected&lt;/span&gt;&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;⟶&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Output&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;Recurrent Neural Networks (RNNs)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;RNNs are designed to process &lt;strong&gt;sequential data&lt;/strong&gt; (e.g., text, time-series) where context and order matter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Architecture of Traditional RNNs&lt;/strong&gt;&lt;br&gt;
Traditional RNNs process input step-by-step, maintaining an internal hidden state (
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;&lt;span class="mord mathnormal"&gt;h&lt;/span&gt;&lt;span class="msupsub"&gt;&lt;span class="vlist-t vlist-t2"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="sizing reset-size6 size3 mtight"&gt;&lt;span class="mord mathnormal mtight"&gt;t&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-s"&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
) that acts as a memory passing information from time step 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;t&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mbin"&gt;−&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
 to 
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;t&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Long short-term memory (LSTM) Gated Recurrent Unit (GRU)&lt;/strong&gt;&lt;br&gt;
Standard RNNs struggle with long sequences due to the vanishing gradient problem. Therefore, LSTM and GRU are create to handle that problem&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LSTM&lt;/strong&gt;: Introduces a dedicated Cell State and three gating mechanisms (Forget Gate, Input Gate, and Output Gate) to selectively retain or discard information over long time horizons.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GRU&lt;/strong&gt;: A streamlined version of LSTM that merges the cell state and hidden state, using only two gates (Reset Gate and Update Gate). It runs faster while offering comparable performance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Autoencoder&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;An Autoencoder is an unsupervised neural network that learns to compress input input data x into a latent code z, and then reconstruct x from z (
&lt;span class="katex-element"&gt;
  &lt;span class="katex"&gt;&lt;span class="katex-mathml"&gt;&lt;/span&gt;&lt;span class="katex-html"&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord text"&gt;&lt;span class="mord"&gt;Reconstruction:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;→&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;z&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;span class="mrel"&gt;→&lt;/span&gt;&lt;span class="mspace"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="base"&gt;&lt;span class="strut"&gt;&lt;/span&gt;&lt;span class="mord accent"&gt;&lt;span class="vlist-t"&gt;&lt;span class="vlist-r"&gt;&lt;span class="vlist"&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="mord mathnormal"&gt;x&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span class="pstrut"&gt;&lt;/span&gt;&lt;span class="accent-body"&gt;&lt;span class="mord"&gt;^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/span&gt;
)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Undercomplete Autoencoder&lt;/strong&gt; &lt;br&gt;
The bottleneck (hidden layer z) has a smaller dimension than the input layer. This forces the model to compress the data, learning the most salient core features.&lt;br&gt;
is we make the hidden layer has the small dimensions than the input, the model must learn to transfer it smaller. For example, The model summarizes the paragraph and then reconstructs the entire paragraph from that summary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Regularized Autoencoders&lt;/strong&gt;&lt;br&gt;
When the hidden layer dimension is equal or to larger than the input (Overcomplete), regularized autoencoders (such as Sparse Autoencoders or Denoising Autoencoders) add penalties or input noise to prevent the network from simply learning an identity copy-paste function.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Training deep neural networks&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Gradient descent&lt;/strong&gt;&lt;br&gt;
Training minimizes the Loss Function over a high-dimensional loss surface. The gradient points in the direction of the steepest ascent, so Gradient Descent takes steps in the opposite direction (scaled by a learning rate) to find a local or global minimum (the lowest point of the loss surface).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Backpropagation&lt;/strong&gt;&lt;br&gt;
Backpropagation relies on the &lt;strong&gt;Chain Rule&lt;/strong&gt; of Calculus to compute the derivative of the loss function with respect to every weight in the network, working backward from the output layer to the input layer to enable parameter updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Preventing overfitting&lt;/strong&gt;&lt;br&gt;
There are three common methods to prevent overfitting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Weight regulation&lt;/strong&gt;: Adds a penalty proportional to the magnitude of the weights to the loss function, preventing any single weight from dominating and keeping the model simpler.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dropout&lt;/strong&gt;: Randomly deactivates a fraction of neurons during training at each iteration. This prevents neurons from co-adapting too strongly and forces the network to learn robust, redundant representations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Batch Normalization&lt;/strong&gt;: Normalizes activations within each mini-batch (zero mean, unit variance) before passing them to the next layer. This stabilizes training, addresses internal covariate shift, acts as a mild regularizer, and allows for higher learning rates.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>computerscience</category>
      <category>deeplearning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Understanding Deep Learning: CHAPTER 2: Supervised learning Notes</title>
      <dc:creator>Hion</dc:creator>
      <pubDate>Mon, 17 Aug 2026 13:33:54 +0000</pubDate>
      <link>https://dev.to/hion/understanding-deep-learning-chapter-2-supervised-learning-notes-1cp</link>
      <guid>https://dev.to/hion/understanding-deep-learning-chapter-2-supervised-learning-notes-1cp</guid>
      <description>&lt;p&gt;Supervised learning is the process where we give a computer an input and its expected output, forcing the computer to figure out how to map that input to that output. The model handles this using a vast number of parameters. Through supervised learning, these parameters are continuously adjusted after failing billion of times, eventually learning how to reach the correct answers. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. The core equation: y = f[x, φ]&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This formula means that from the  &lt;strong&gt;input x&lt;/strong&gt;, we get the &lt;strong&gt;predicted output y&lt;/strong&gt;. Here, φ represents the parameters (weights and biases) that the model to find so that, through mathematical operations, it can accurately predict y from x.&lt;/p&gt;

&lt;p&gt;Depending on what y is, supervised learning is divided into two main types of problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Regression: Used when the output y is a &lt;strong&gt;continuous number&lt;/strong&gt;. For example, predicting a house price or tomorrow's temperature.&lt;/li&gt;
&lt;li&gt; Classification: Used when the output y is a &lt;strong&gt;discrete label/category&lt;/strong&gt;. For example, identifying whether an image is a "cat" or "dog", or detecting if an email is "spam" or "not spam".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This process works similarly to &lt;strong&gt;matrix transformations&lt;/strong&gt;. The input shape, combined with specific parameter and weights, goes through calculations to yield the final output shape.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. How the Model Self-Corrects: Derivatives &amp;amp; Gradient Descent&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The process behind adjusting these parameters is driven by &lt;strong&gt;derivatives&lt;/strong&gt; and &lt;strong&gt;gradient descent&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;With the initial parameters chosen randomly, the loss is usually very high. The model must find a way to reduce this error little by little, and the key methods for this is taking derivatives. A derivative is basically a &lt;strong&gt;gradient&lt;/strong&gt; (the slope of the error hill). By calculating the derivative with respect to each parameter, the model knows exactly which direction to move. This continuous adjustment forces the loss to decrease step by step, until it reach the flat bottom where it cannot be reduced anymore.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. Evaluating Performance: Loss &amp;amp; Testing&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Loss&lt;/strong&gt; is the metric used to evaluate how accurate the model's prediction are. The loss value will be very highly (poor) if the model makes an incorrect prediction with a high confident, or if it makes a correct prediction but with very low confident. The ultimate goal of &lt;strong&gt;training&lt;/strong&gt; is to reduce this loss.&lt;/p&gt;

&lt;p&gt;To evaluate the model properly and prevent it from just "memorizing" answers, we don't just use one dataset. Instead, the data is usually split into three distinct parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Training Set&lt;/strong&gt;: The data the model uses to learn and adjust its parameters through gradient descent (like doing homework).&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Validation Set&lt;/strong&gt;: The data used to test the model during training. It helps us tune the model's structure and check if it is starting to overfit (like a practice quiz before the real exam).&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Testing Set&lt;/strong&gt;: The final exam. This data is kept completely hidden until training is finished to see how the model performs in the real world.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During this evaluation process, we often encounter two major issues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;Underfitting&lt;/strong&gt;: The model learns nothing and performs poorly on both training and testing data.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Overfitting&lt;/strong&gt;: The model just memorizes the training data, making it unable to predict anything new.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>learning</category>
    </item>
    <item>
      <title>Class Notes: Making Sense of Dynamic Programming</title>
      <dc:creator>Hion</dc:creator>
      <pubDate>Fri, 24 Jul 2026 10:07:47 +0000</pubDate>
      <link>https://dev.to/hion/class-notes-making-sense-of-dynamic-programming-1o62</link>
      <guid>https://dev.to/hion/class-notes-making-sense-of-dynamic-programming-1o62</guid>
      <description>&lt;p&gt;This is just a quick note to log how I understand Dynamic Programming after listening to the lecture in class today.&lt;/p&gt;




&lt;p&gt;Dynamic programming (DP) is very similar to the &lt;strong&gt;Divide and Conquer&lt;/strong&gt; algorithm. The main difference is that in DP, the subproblems tend to repeat.&lt;/p&gt;

&lt;p&gt;There are three core ideas to remember about DP:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Optimal Substructure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Like Divide and Conquer, a big problem is broken down into many smaller subproblems. We can solve the main problem by finding and selecting the optimal outputs of these subproblems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Example (Floyd-Warshall Algorithm): To find the shortest paths between all pairs of vertices in a graph, we break it down by finding the shortest path between each specific pair &lt;em&gt;(u, v)&lt;/em&gt; first. Combining these optimal sub-answers gives us the final solution for the entire graph.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Overlapping subproblems&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;in DP, the same subproblems show up over and over again. Instead of recalculating the exact same answer every time, DP solves it once, saves the result, and reuses it later.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Example: Imagine you want to find the shortest path to school from two different starting locations: your &lt;strong&gt;home&lt;/strong&gt; and your &lt;strong&gt;grandparent's house&lt;/strong&gt;. Both routes must pass through the &lt;strong&gt;stationary store&lt;/strong&gt; to reach school
 Path(home -&amp;gt; school) = dis(home -&amp;gt; store) + dis(store -&amp;gt; school)
 Path(grandparent-&amp;gt;school) = dis(grandparent -&amp;gt; store) + dis(store -&amp;gt; school)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;as you can see, the fragment dis(store -&amp;gt; school) is shared. DP calculates this distance once, saves it, and instantly reuses it for both routes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Table-Based Solution Tracking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To build the final solution, DP keeps track of all sub-problem answers in a table (often called a DP table or memoization table). This is how we synthesize everything together.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Example: Suppose from your home, you can choose to pass through either a &lt;strong&gt;grocery store&lt;/strong&gt;, a &lt;strong&gt;convenience store&lt;/strong&gt; or a &lt;strong&gt;book store&lt;/strong&gt; to get to school. &lt;/li&gt;
&lt;li&gt; Your subproblems are finding the shortest path from home to each store to the school. DP saves all these options in a table. In the end, you look at the table, compare the total costs, and pick the single best store to pass through to minimize your travel time.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>My Study Notes on Fastai: Chapter 1</title>
      <dc:creator>Hion</dc:creator>
      <pubDate>Thu, 23 Jul 2026 10:12:56 +0000</pubDate>
      <link>https://dev.to/hion/my-study-notes-on-fastai-chapter-1-443p</link>
      <guid>https://dev.to/hion/my-study-notes-on-fastai-chapter-1-443p</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;1. Parallel distributed processing (PDP)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Traditional computer program&lt;/em&gt; work very differently from brains. That might be why computer programs had been so bad at doing things that brains find easy, such as recognizing objects in picture. To solve this, PDP was developed as an architecture to imitate how the brain works.&lt;/p&gt;

&lt;p&gt;According to the book, a PDP system requires eight essential components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A set of processing units&lt;/li&gt;
&lt;li&gt;A state of activation&lt;/li&gt;
&lt;li&gt;An output function for each unit&lt;/li&gt;
&lt;li&gt;A pattern of connectivity among units&lt;/li&gt;
&lt;li&gt;A propagation rule&lt;/li&gt;
&lt;li&gt;An activation rule&lt;/li&gt;
&lt;li&gt;A learning rule&lt;/li&gt;
&lt;li&gt;An environment&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. A Brief History of Neural Networks (The two AI winters)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In the past, Marvin Minsky showed that single-layer neural network could not learning critical math function (like XOR gate). For example, a simple computer couldn't correctly classify an object if the input shared characteristics of both categories. In the same book, the authors also show that adding more layers could easily solve this problem. Unfortunately, the public only focused on the negative statement. As a result, funding dried up, and the first AI Winter began.&lt;/p&gt;

&lt;p&gt;In the 1980s, researcher started exploring two-layer models. Theoretically, twos layers were enough to learn any mathematical function. However, in practice, these models were too large and too slow to be useful at the time. This triggered the second AI Winter.&lt;/p&gt;

&lt;p&gt;Today, technology has finally caught up. We now use GPUs to solve the speed and size limitations of the past. To put in simply: a CPU is great at solving a few big, complex problems, but it takes too long when handling thousands of tiny tasks. On the other hand, a GPU is designed to solve thousands of small problems (like rendering pixels) at the exact same time, By using GPUs to boost performance, AI has finally experienced a massive revival.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. The Difference between Machine Learning and Deep Learning&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Deep learning is just a modern subfield within the boarder discipline of machine learning.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Machine learning requires humans to manually select and extract features (characteristics) from the data before feeding it to the model. &lt;/li&gt;
&lt;li&gt;Deep learning automatically learns the characteristics of an object directly from raw data without needing human intervention.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. The Universal Framework: Arthur Samuel's Model&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr1vi88iwb9xs5okmzj6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr1vi88iwb9xs5okmzj6q.png" alt=" " width="787" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Modern Deep Learning is a direct implementation of Arthur Samuel's concept, but with professional technical terms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Architecture&lt;/strong&gt;: The mathematical structure of the model (previously called Model).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parameters&lt;/strong&gt;: The setting/weights inside the model that change as it learns (previously called Weights).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Predictions&lt;/strong&gt;: The model's guesses based on inputs and parameters (previously called Results).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Loss&lt;/strong&gt;: The scoring system that measures how wrong the predictions are compared to the Labels (previously called Performance).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;5. Universal Approximation Theorem&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Universal Approximation Theorem is a mathematical proof showing that deep neural networks can theoretically solve any complex problem. However, in practice, because of limits in computer hardware and the amount of data we have, we cannot solve literally everything, but it is still incredibly powerful.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;6. Current Limitations of Deep Learning&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Requires Labeled Data&lt;/strong&gt;: Models cannot learn by themselves; humans must label the objects (e.g., tagginf which image is a cat or a dog) before training.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The "Black Box" Problems&lt;/strong&gt;: If a model only has a few layers, we can easily see which variables are important. But deep networks have hundreds of layers, making them hard to understand. Fortunately, we can now step-by-step visualize how they work (such as checking what the first layer sees, like lines or shapes).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cannot Predict Beyond Training Data&lt;/strong&gt;: The model will predict poorly if the testing condition is too different from the training data. For example, if we only train it with daytime images, it will fail when testing with nighttime images.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>deeplearning</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
