<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>FNN | Portfolio</title><link>https://ansangah.github.io/en/tags/fnn/</link><atom:link href="https://ansangah.github.io/en/tags/fnn/index.xml" rel="self" type="application/rss+xml"/><description>FNN</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en</language><lastBuildDate>Wed, 22 Oct 2025 00:00:00 +0000</lastBuildDate><image><url>https://ansangah.github.io/media/sharing.png</url><title>FNN</title><link>https://ansangah.github.io/en/tags/fnn/</link></image><item><title>📁 Chapter 2: Feedforward Neural Network (FNN) Summary</title><link>https://ansangah.github.io/en/blog/ai-blog/2fnn/</link><pubDate>Wed, 22 Oct 2025 00:00:00 +0000</pubDate><guid>https://ansangah.github.io/en/blog/ai-blog/2fnn/</guid><description>&lt;h2 id="1-overview-of-feedforward-neural-networks-fnn"&gt;1. Overview of Feedforward Neural Networks (FNN)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;FNN&lt;/strong&gt; = Feedforward Neural Network (also called Fully Connected Neural Network).&lt;br&gt;
Most FNNs adopt a fully connected architecture, so the two terms are often used interchangeably.&lt;/li&gt;
&lt;li&gt;It is another name for the &lt;strong&gt;Multilayer Perceptron (MLP)&lt;/strong&gt;, the most fundamental form of an artificial neural network.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Universal Approximation Theorem&lt;/strong&gt;:&lt;br&gt;
With a sufficient number of hidden neurons and an appropriate activation function, an FNN can approximate any &lt;em&gt;n&lt;/em&gt;-dimensional continuous function to an arbitrary degree of accuracy.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="2-structure-and-design-of-fnn"&gt;2. Structure and Design of FNN&lt;/h2&gt;
&lt;p&gt;An FNN has &lt;strong&gt;unidirectional data flow&lt;/strong&gt; — signals move only forward.&lt;br&gt;
Each neuron performs &lt;em&gt;weighted summation → activation function&lt;/em&gt;.&lt;br&gt;
Importantly, it assumes independence among data points (no recurrent connections).&lt;/p&gt;
&lt;h3 id="21-layer-structure"&gt;2.1 Layer Structure&lt;/h3&gt;
&lt;p&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;
&lt;img alt="Layer Structure"
srcset="https://ansangah.github.io/blog/ai-blog/2fnn/image_hu_d2afa73b8980d80d.webp 320w, https://ansangah.github.io/blog/ai-blog/2fnn/image_hu_92045be633531587.webp 369w"
sizes="(max-width: 480px) 100vw, (max-width: 768px) 90vw, (max-width: 1024px) 80vw, 760px"
src="https://ansangah.github.io/blog/ai-blog/2fnn/image_hu_d2afa73b8980d80d.webp"
width="369"
height="248"
loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Input layer&lt;/strong&gt;: receives external data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hidden layer(s)&lt;/strong&gt;: extracts features&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Output layer&lt;/strong&gt;: produces predictions or classifications&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Usually there is one input and one output layer;&lt;br&gt;
the &lt;strong&gt;number of hidden layers&lt;/strong&gt; varies depending on task complexity.&lt;/p&gt;
&lt;h3 id="22-fully-connected-fc-layers"&gt;2.2 Fully Connected (FC) Layers&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Every neuron in one layer is &lt;strong&gt;connected to every neuron&lt;/strong&gt; in the previous layer.&lt;/li&gt;
&lt;li&gt;Even with the same input, different neurons extract &lt;strong&gt;different features&lt;/strong&gt; — more neurons allow richer representation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Weighted summation&lt;/strong&gt;: assigns greater weights to important features.&lt;br&gt;
$$
z = \sum_i w_i x_i + b
$$&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Activation function&lt;/strong&gt;: introduces nonlinearity, essential for learning complex patterns (e.g., XOR).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="23-relu-rectified-linear-unit"&gt;2.3 ReLU (Rectified Linear Unit)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;$$x &amp;gt; 0 \Rightarrow x,\quad x \le 0 \Rightarrow 0$$&lt;/li&gt;
&lt;li&gt;Computationally efficient and stabilizes training.&lt;/li&gt;
&lt;li&gt;Neural networks must be differentiable (or piecewise differentiable) to allow backpropagation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="24-universal-approximation-and-network-depth"&gt;2.4 Universal Approximation and Network Depth&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Even a 2-layer FNN can approximate continuous functions with enough hidden neurons.&lt;/li&gt;
&lt;li&gt;However, increasing neurons arbitrarily leads to &lt;strong&gt;overfitting&lt;/strong&gt; →&lt;br&gt;
stacking deeper layers can achieve the same performance with fewer neurons.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="25-design-checklist"&gt;2.5 Design Checklist&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Input shape&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Output shape / activation function&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hidden-layer activation function&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network size&lt;/strong&gt; (depth &amp;amp; width)&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="3-classification-vs-regression"&gt;3. Classification vs. Regression&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Classification&lt;/strong&gt;: predicts a &lt;em&gt;category (class)&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Regression&lt;/strong&gt;: predicts a &lt;em&gt;continuous value&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Classification can be viewed as a &lt;strong&gt;discriminant function&lt;/strong&gt; (decision boundary) or a &lt;strong&gt;probabilistic model&lt;/strong&gt; (predicting class probabilities).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="4-binary-classification-model"&gt;4. Binary Classification Model&lt;/h2&gt;
&lt;p&gt;Binary classification models predict a &lt;strong&gt;Bernoulli distribution&lt;/strong&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Output activation: &lt;strong&gt;Sigmoid&lt;/strong&gt;&lt;br&gt;
$$\sigma(z) = \frac{1}{1 + e^{-z}}$$&lt;/li&gt;
&lt;li&gt;Loss function: &lt;strong&gt;Binary Cross-Entropy&lt;/strong&gt;, which pairs naturally with the sigmoid output.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="5-multi-class-classification-model"&gt;5. Multi-class Classification Model&lt;/h2&gt;
&lt;p&gt;Multi-class classification predicts a &lt;strong&gt;categorical (multinomial)&lt;/strong&gt; distribution.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Output activation: &lt;strong&gt;Softmax&lt;/strong&gt;&lt;br&gt;
$\mathrm{softmax}(z)_k = \frac{e^{z_k}}{\sum_j e^{z_j}}$&lt;/li&gt;
&lt;li&gt;Loss function: &lt;strong&gt;Categorical Cross-Entropy&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;Note: Binary classification can also be expressed as a 2-dimensional softmax,&lt;br&gt;
but it’s typically simplified to a 1-dimensional sigmoid model.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id="6-regression-model"&gt;6. Regression Model&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Regression often assumes observation noise follows a &lt;strong&gt;Gaussian distribution&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The model usually predicts the &lt;strong&gt;mean ( \mu = y(x) )&lt;/strong&gt; only (variance is treated as constant).&lt;/li&gt;
&lt;li&gt;Output activation: &lt;strong&gt;Identity function&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="7-input-layer"&gt;7. Input Layer&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;If the input is an &lt;em&gt;n&lt;/em&gt;-dimensional vector, the input layer should have &lt;em&gt;n&lt;/em&gt; neurons.&lt;/li&gt;
&lt;li&gt;Example: a 28×28 image is &lt;strong&gt;flattened&lt;/strong&gt; into a 784-dimensional input vector.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="8-summary-of-activation-functions"&gt;8. Summary of Activation Functions&lt;/h2&gt;
&lt;h3 id="81-sigmoid-family"&gt;8.1 Sigmoid Family&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Pros: differentiable everywhere, squashes values into [0, 1].&lt;/li&gt;
&lt;li&gt;Cons: exponential computation cost, &lt;strong&gt;gradient saturation/vanishing&lt;/strong&gt;,&lt;br&gt;
outputs are positive → optimization path may oscillate.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="82-hyperbolic-tangent-tanh"&gt;8.2 Hyperbolic Tangent (tanh)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Range [-1, 1], reducing oscillation in optimization.&lt;/li&gt;
&lt;li&gt;Still suffers from exponential computation and saturation problems.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="83-relu-family"&gt;8.3 ReLU Family&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ReLU&lt;/strong&gt;: fast, robust to saturation/vanishing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Leaky ReLU / PReLU&lt;/strong&gt;: assigns small slope in negative region to mitigate “dead ReLU.”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ELU&lt;/strong&gt;: exponential negative region — stable even for large negative inputs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Maxout&lt;/strong&gt;: neuron output = max of several linear functions → activation is &lt;em&gt;learned&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Swish (SiLU)&lt;/strong&gt;: (x \cdot \sigma(x)); modern nonlinearity with strong empirical performance.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="9-network-size-width--depth"&gt;9. Network Size (Width &amp;amp; Depth)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Width&lt;/strong&gt;: number of neurons per layer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Depth&lt;/strong&gt;: number of layers&lt;/li&gt;
&lt;li&gt;Search strategies: &lt;strong&gt;Random Search&lt;/strong&gt; is generally more efficient than exhaustive &lt;strong&gt;Grid Search&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Modern approaches include &lt;strong&gt;Neural Architecture Search (NAS)&lt;/strong&gt; for automated structure optimization.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="91-scaling-strategy"&gt;9.1 Scaling Strategy&lt;/h3&gt;
&lt;p&gt;As demonstrated by &lt;strong&gt;EfficientNet&lt;/strong&gt;, jointly scaling &lt;strong&gt;width, depth, and input resolution&lt;/strong&gt; —&lt;br&gt;
called &lt;strong&gt;Compound Scaling&lt;/strong&gt; — yields more efficient performance improvements.&lt;/p&gt;
&lt;hr&gt;
&lt;div class="text-center"&gt;
&lt;a
id="button-b8fff8de9736d3d13548a241312882d4"
href="https://ansangah.github.io/uploads/deeplearning/2-%ec%88%9c%eb%b0%a9%ed%96%a5%ec%8b%a0%ea%b2%bd%eb%a7%9d.pdf"
class="inline-flex items-center gap-2 font-medium no-underline transition-all duration-300 ease-out transform-gpu focus:outline-none focus:ring-4 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-zinc-900 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none bg-gradient-to-br from-primary-500 to-primary-600 hover:from-primary-600 hover:to-primary-700 active:from-primary-700 active:to-primary-800 text-white shadow-lg shadow-primary-500/25 hover:shadow-xl hover:shadow-primary-500/30 hover:-translate-y-0.5 hover:scale-[1.02] active:scale-[0.98] focus:ring-primary-500/50 px-6 py-3 text-lg rounded-lg"
role="button"
aria-label="Download PDF"
&gt;
&lt;span class="flex-shrink-0"&gt;
&lt;svg class="w-4 h-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m.75 12l3 3m0 0l3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"/&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;span&gt;Download PDF&lt;/span&gt;
&lt;/a&gt;
&lt;/div&gt;</description></item></channel></rss>