<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Rnn on IT Comparison</title><link>https://comparison.metacog.co.kr/tags/rnn/</link><description>Recent content in Rnn on IT Comparison</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 03 Aug 2026 03:33:36 +0900</lastBuildDate><atom:link href="https://comparison.metacog.co.kr/tags/rnn/index.xml" rel="self" type="application/rss+xml"/><item><title>LSTM vs GRU: Three Gates vs Two Gates in Recurrent Memory</title><link>https://comparison.metacog.co.kr/posts/2026-08-03-lstm-vs-gru-three-gates-vs-two-gates-in-recurrent-memory/</link><pubDate>Mon, 03 Aug 2026 03:33:36 +0900</pubDate><guid>https://comparison.metacog.co.kr/posts/2026-08-03-lstm-vs-gru-three-gates-vs-two-gates-in-recurrent-memory/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;LSTM and GRU are both gated recurrent architectures built to capture long-range dependencies in sequences while avoiding the vanishing-gradient problem of vanilla RNNs. LSTM keeps a dedicated &lt;strong class="kw"&gt;cell state&lt;/strong&gt; alongside its hidden state, regulated by three gates, while GRU folds everything into a single &lt;strong class="kw"&gt;hidden state&lt;/strong&gt; updated by just two gates. That structural difference drives everything else: parameter count, training speed, and how precisely you can control what the network remembers.&lt;/p&gt;</description></item><item><title>CNN vs RNN: Spatial Convolution vs Sequential Recurrence</title><link>https://comparison.metacog.co.kr/posts/2026-08-03-cnn-vs-rnn-spatial-convolution-vs-sequential-recurrence/</link><pubDate>Mon, 03 Aug 2026 03:31:06 +0900</pubDate><guid>https://comparison.metacog.co.kr/posts/2026-08-03-cnn-vs-rnn-spatial-convolution-vs-sequential-recurrence/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) are neural architectures built for different data shapes: CNNs slide &lt;strong class="kw"&gt;convolutional filters&lt;/strong&gt; across a spatial grid to detect local patterns, while RNNs pass a &lt;strong class="kw"&gt;recurrent hidden state&lt;/strong&gt; across time steps to model sequential dependencies. Choosing between them (or their modern successors) depends on whether your data&amp;rsquo;s structure is spatial, temporal, or both.&lt;/p&gt;
&lt;h2 id="comparison-diagram"&gt;Comparison Diagram&lt;/h2&gt;
&lt;div class="compare-diagram"&gt;
&lt;svg viewBox="0 0 640 360" xmlns="http://www.w3.org/2000/svg"&gt;&lt;defs&gt;&lt;marker id="arrowA" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto"&gt;&lt;path d="M0,0 L8,4 L0,8 Z" style="fill:var(--compare-a)"/&gt;&lt;/marker&gt;&lt;marker id="arrowB" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto"&gt;&lt;path d="M0,0 L8,4 L0,8 Z" style="fill:var(--compare-b)"/&gt;&lt;/marker&gt;&lt;/defs&gt;&lt;line x1="320" y1="65" x2="320" y2="310" style="stroke:var(--border)" stroke-width="1.5" stroke-dasharray="4,4"/&gt;&lt;text x="150" y="32" text-anchor="middle" style="fill:var(--primary)" font-size="20" font-weight="bold"&gt;CNN&lt;/text&gt;&lt;text x="150" y="52" text-anchor="middle" style="fill:var(--secondary)" font-size="12"&gt;Convolution over a spatial grid&lt;/text&gt;&lt;rect x="52" y="90" width="104" height="104" style="fill:var(--compare-a-soft);stroke:var(--compare-a)" stroke-width="1.5"/&gt;&lt;line x1="78" y1="90" x2="78" y2="194" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;line x1="104" y1="90" x2="104" y2="194" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;line x1="130" y1="90" x2="130" y2="194" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;line x1="52" y1="116" x2="156" y2="116" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;line x1="52" y1="142" x2="156" y2="142" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;line x1="52" y1="168" x2="156" y2="168" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;rect x="52" y="90" width="52" height="52" style="fill:none;stroke:var(--compare-a)" stroke-width="3"/&gt;&lt;line x1="108" y1="116" x2="123" y2="116" style="stroke:var(--compare-a)" stroke-width="2" marker-end="url(#arrowA)"/&gt;&lt;line x1="160" y1="142" x2="191" y2="142" style="stroke:var(--compare-a)" stroke-width="2" marker-end="url(#arrowA)"/&gt;&lt;text x="176" y="132" text-anchor="middle" style="fill:var(--secondary)" font-size="10"&gt;convolve&lt;/text&gt;&lt;rect x="196" y="112" width="54" height="54" style="fill:var(--compare-a-soft);stroke:var(--compare-a)" stroke-width="1.5"/&gt;&lt;line x1="214" y1="112" x2="214" y2="166" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;line x1="232" y1="112" x2="232" y2="166" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;line x1="196" y1="130" x2="250" y2="130" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;line x1="196" y1="148" x2="250" y2="148" style="stroke:var(--border)" stroke-width="1"/&gt;&lt;text x="150" y="215" text-anchor="middle" style="fill:var(--secondary)" font-size="10.5"&gt;Filter weights shared across all positions&lt;/text&gt;&lt;text x="150" y="229" text-anchor="middle" style="fill:var(--secondary)" font-size="10.5"&gt;Captures local spatial patterns&lt;/text&gt;&lt;text x="150" y="300" text-anchor="middle" style="fill:var(--secondary)" font-size="11"&gt;Best for grid-structured data (images)&lt;/text&gt;&lt;text x="460" y="32" text-anchor="middle" style="fill:var(--primary)" font-size="20" font-weight="bold"&gt;RNN&lt;/text&gt;&lt;text x="460" y="52" text-anchor="middle" style="fill:var(--secondary)" font-size="12"&gt;Recurrence over a sequence&lt;/text&gt;&lt;rect x="360" y="130" width="40" height="40" style="fill:var(--compare-b-soft);stroke:var(--compare-b)" stroke-width="1.5"/&gt;&lt;rect x="440" y="130" width="40" height="40" style="fill:var(--compare-b-soft);stroke:var(--compare-b)" stroke-width="1.5"/&gt;&lt;rect x="520" y="130" width="40" height="40" style="fill:var(--compare-b-soft);stroke:var(--compare-b)" stroke-width="1.5"/&gt;&lt;text x="380" y="155" text-anchor="middle" style="fill:var(--content)" font-size="14"&gt;h1&lt;/text&gt;&lt;text x="460" y="155" text-anchor="middle" style="fill:var(--content)" font-size="14"&gt;h2&lt;/text&gt;&lt;text x="540" y="155" text-anchor="middle" style="fill:var(--content)" font-size="14"&gt;h3&lt;/text&gt;&lt;line x1="400" y1="150" x2="439" y2="150" style="stroke:var(--compare-b)" stroke-width="2" marker-end="url(#arrowB)"/&gt;&lt;line x1="480" y1="150" x2="519" y2="150" style="stroke:var(--compare-b)" stroke-width="2" marker-end="url(#arrowB)"/&gt;&lt;line x1="380" y1="214" x2="380" y2="171" style="stroke:var(--compare-b)" stroke-width="2" marker-end="url(#arrowB)"/&gt;&lt;line x1="460" y1="214" x2="460" y2="171" style="stroke:var(--compare-b)" stroke-width="2" marker-end="url(#arrowB)"/&gt;&lt;line x1="540" y1="214" x2="540" y2="171" style="stroke:var(--compare-b)" stroke-width="2" marker-end="url(#arrowB)"/&gt;&lt;text x="380" y="228" text-anchor="middle" style="fill:var(--content)" font-size="12"&gt;x1&lt;/text&gt;&lt;text x="460" y="228" text-anchor="middle" style="fill:var(--content)" font-size="12"&gt;x2&lt;/text&gt;&lt;text x="540" y="228" text-anchor="middle" style="fill:var(--content)" font-size="12"&gt;x3&lt;/text&gt;&lt;line x1="380" y1="129" x2="380" y2="87" style="stroke:var(--compare-b)" stroke-width="2" marker-end="url(#arrowB)"/&gt;&lt;line x1="460" y1="129" x2="460" y2="87" style="stroke:var(--compare-b)" stroke-width="2" marker-end="url(#arrowB)"/&gt;&lt;line x1="540" y1="129" x2="540" y2="87" style="stroke:var(--compare-b)" stroke-width="2" marker-end="url(#arrowB)"/&gt;&lt;text x="380" y="78" text-anchor="middle" style="fill:var(--content)" font-size="12"&gt;y1&lt;/text&gt;&lt;text x="460" y="78" text-anchor="middle" style="fill:var(--content)" font-size="12"&gt;y2&lt;/text&gt;&lt;text x="540" y="78" text-anchor="middle" style="fill:var(--content)" font-size="12"&gt;y3&lt;/text&gt;&lt;text x="460" y="246" text-anchor="middle" style="fill:var(--secondary)" font-size="10.5"&gt;Hidden state carries context&lt;/text&gt;&lt;text x="460" y="260" text-anchor="middle" style="fill:var(--secondary)" font-size="10.5"&gt;forward through the sequence&lt;/text&gt;&lt;text x="460" y="300" text-anchor="middle" style="fill:var(--secondary)" font-size="11"&gt;Best for sequential/time-ordered data&lt;/text&gt;&lt;/svg&gt;
&lt;/div&gt;
&lt;h2 id="comparison-table"&gt;Comparison Table&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;CNN&lt;/th&gt;
&lt;th&gt;RNN&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Input data shape&lt;/td&gt;
&lt;td&gt;Fixed-size spatial grid (2D/3D tensors like images)&lt;/td&gt;
&lt;td&gt;Variable-length ordered sequence (text, time series, audio)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Core operation&lt;/td&gt;
&lt;td&gt;Convolution: a filter slides over local receptive fields&lt;/td&gt;
&lt;td&gt;Recurrence: hidden state updated step-by-step from previous state plus current input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Weight sharing&lt;/td&gt;
&lt;td&gt;Same filter weights reused across all spatial positions&lt;/td&gt;
&lt;td&gt;Same weight matrices reused across all time steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context captured&lt;/td&gt;
&lt;td&gt;Local spatial neighborhoods, expanded via depth/pooling&lt;/td&gt;
&lt;td&gt;Temporal history accumulated in the hidden state over prior steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Order sensitivity&lt;/td&gt;
&lt;td&gt;Largely order-invariant beyond local structure; pooling discards exact position&lt;/td&gt;
&lt;td&gt;Strictly order-dependent; reordering the sequence changes the output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Training parallelization&lt;/td&gt;
&lt;td&gt;Highly parallelizable across positions, channels, and layers&lt;/td&gt;
&lt;td&gt;Inherently sequential; each step waits on the previous hidden state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Common failure mode&lt;/td&gt;
&lt;td&gt;Limited receptive field unless network is deep or uses dilation&lt;/td&gt;
&lt;td&gt;Vanishing/exploding gradients over long sequences&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical applications&lt;/td&gt;
&lt;td&gt;Image classification, object detection, segmentation&lt;/td&gt;
&lt;td&gt;Language modeling, time-series forecasting, speech recognition&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="key-differences"&gt;Key Differences&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CNNs assume spatially local structure and share &lt;strong class="kw"&gt;filter weights&lt;/strong&gt; across the whole input; RNNs share weights across time steps instead.&lt;/li&gt;
&lt;li&gt;CNN layers process all positions in parallel, while RNNs are &lt;strong class="kw"&gt;sequential&lt;/strong&gt; by construction since each step needs the prior hidden state.&lt;/li&gt;
&lt;li&gt;RNNs suffer from &lt;strong class="kw"&gt;vanishing gradients&lt;/strong&gt; over long sequences; CNNs sidestep this but need deeper stacks to grow their receptive field.&lt;/li&gt;
&lt;li&gt;Shuffling pixels barely changes what a CNN detects, but reordering a sequence fed to an RNN changes the output entirely, since RNNs are &lt;strong class="kw"&gt;order-sensitive&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;CNNs expect fixed-size grid inputs, whereas RNNs natively handle &lt;strong class="kw"&gt;variable-length&lt;/strong&gt; sequences.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="when-to-use-each"&gt;When to Use Each&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;CNN&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>