<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Deep Learning on YennJ12 Engineering Blog</title><link>https://yennj12.js.org/yennj12_blog_V4/tags/deep-learning/</link><description>Recent content in Deep Learning on YennJ12 Engineering Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 21 Jun 2026 11:00:00 +0800</lastBuildDate><atom:link href="https://yennj12.js.org/yennj12_blog_V4/tags/deep-learning/feed.xml" rel="self" type="application/rss+xml"/><item><title>AI 工程從零開始｜Phase 3：深度學習核心 — 從第一原理構建神經網路</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/ai-eng-from-scratch-phase3-part1-neural-networks-zh/</link><pubDate>Sun, 21 Jun 2026 11:00:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/ai-eng-from-scratch-phase3-part1-neural-networks-zh/</guid><description>大多數人學深度學習：model.fit() 呼叫一行，調調 learning rate，祈禱 loss 下降。 正確的方式是：從矩陣乘法開始，手算梯度，理解每個超參數的幾何意義—— 因為當模型在生產環境爆炸時，你唯一能依靠的，是對第一原理的理解。 框架可以抽象實作，但它無法替你理解為什麼。
面試情境 你正在設計一個即時推薦系統，模型需要在 &amp;lt; 20ms 內回應，訓練資料有 5 億筆互動記錄，特徵空間包含 1 萬維稀疏向量。面試官問：「你會如何設計神經網路架構？選擇什麼激活函數、正則化策略、和最佳化器？當模型在驗證集準確率停滯在 78% 時，你的診斷流程是什麼？」
一、核心問題：為什麼要從第一原理理解神經網路 絕大多數工程師進入深度學習的路徑是：安裝 PyTorch，複製一段 ResNet 範例程式，調整幾個參數，模型能跑了就交差。這種「黑盒操作」在 Kaggle 比賽或 Demo 原型中勉強夠用，但在生產環境中，它會讓你付出慘痛代價。
真實問題是這樣出現的：
模型訓練時 loss 突然爆炸（NaN），你不知道是梯度消失還是梯度爆炸，因為你從未手算過梯度 推論延遲從 8ms 升到 150ms，但你不理解 BatchNorm 在推論階段的行為與訓練階段不同 模型在訓練集 95% 準確率，測試集 61%，你不知道該加 Dropout 還是 L2，還是兩者都要 換了 AdamW 替代 SGD 後，收斂快了但泛化變差，你不知道 weight decay 的幾何意義是什麼 從第一原理理解神經網路，解決的不是「能不能跑起來」，而是「出問題時能不能診斷並修復」。
本文的工程目標：
理解神經網路的數學本質，能手算任意小型網路的前向與反向傳播 能在沒有框架的情況下，用純 NumPy 實作一個可訓練的兩層網路 掌握每個設計決策（激活函數、正則化、最佳化器）的量化 tradeoff 能在面試中給出有數字支撐的架構決策，而非「視情況而定」 二、三個演進階段（POC / MVP / Scale） 神經網路的部署不是一蹴而就，從研究原型到生產規模，架構在每個階段都有根本性的不同。</description></item><item><title>FDE 面試準備指南（八）：ML 基礎必備——從傳統機器學習到 Deep Learning</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/fde-interview-guide-part8-ml-fundamentals-zh/</link><pubDate>Sun, 31 May 2026 10:30:00 +0800</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/fde-interview-guide-part8-ml-fundamentals-zh/</guid><description>FDE 不是 ML 研究員，你不需要推導反向傳播的數學。
但你必須在面試官提到 XGBoost、Attention、Regularization 這些詞時，
能夠自然地接話，而不是露出「我需要查一下」的表情。
這篇整理的是「必須熟悉到反應是直覺的」那個程度。
一、傳統機器學習基礎 Supervised Learning（監督式學習） 監督式學習的本質：從有標籤的資料中學習一個 mapping function。
f(X) → Y X = 特徵（features） Y = 標籤（labels） 兩大任務類型：
Regression（回歸）：Y 是連續值（房價預測、銷售量預測） Classification（分類）：Y 是離散類別（垃圾郵件判斷、圖片分類） Linear Regression（線性回歸） 最簡單的回歸模型：
ŷ = w₁x₁ + w₂x₂ + ... + wₙxₙ + b 訓練目標：最小化 MSE（Mean Squared Error）：
MSE = (1/n) × Σ(yᵢ - ŷᵢ)² 面試要能說的重點：
假設特徵和目標之間是線性關係 對 outlier 敏感（因為誤差平方放大了異常值的影響） 多重共線性（features 之間高度相關）會讓模型不穩定 Logistic Regression（邏輯回歸） 名字有 Regression，但其實是分類模型。
把線性組合通過 sigmoid 函數轉成機率：
p = sigmoid(w·x + b) = 1 / (1 + e^(-z)) 輸出的是 P(Y=1|X)，閾值（通常 0.</description></item><item><title>Deploying Hugging Face Models to AWS: A Complete Guide with CDK, SageMaker, and Lambda</title><link>https://yennj12.js.org/yennj12_blog_V4/posts/deploying-huggingface-models-aws-cdk-sagemaker/</link><pubDate>Sun, 30 Nov 2025 12:00:00 +0000</pubDate><guid>https://yennj12.js.org/yennj12_blog_V4/posts/deploying-huggingface-models-aws-cdk-sagemaker/</guid><description>🎯 Introduction Deploying machine learning models to production is a complex challenge that goes far beyond training a model. When working with large models from Hugging Face—whether it&amp;rsquo;s image generation, text-to-image synthesis, or other AI tasks—you need robust infrastructure that handles:
Scalability: Auto-scaling to handle variable loads from 0 to thousands of concurrent requests Cost Efficiency: Paying only for what you use while maintaining performance Reliability: 99.9%+ uptime with proper error handling and monitoring Security: Protecting models, data, and API endpoints Observability: Comprehensive logging, metrics, and tracing This comprehensive guide demonstrates how to deploy a Hugging Face model to AWS using infrastructure as code (CDK with TypeScript), combining SageMaker for model hosting and Lambda for API orchestration.</description></item></channel></rss>