<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Po-Lin (Berlin) Chen on Medium]]></title>
        <description><![CDATA[Stories by Po-Lin (Berlin) Chen on Medium]]></description>
        <link>https://medium.com/@berlinnn3388?source=rss-2ce077012a76------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*76NHZ7s3IGefQD3A3ue5rQ.jpeg</url>
            <title>Stories by Po-Lin (Berlin) Chen on Medium</title>
            <link>https://medium.com/@berlinnn3388?source=rss-2ce077012a76------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 16:12:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@berlinnn3388/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[美國留學 | 2026 Spring | CMU MSCV 2nd Semester]]></title>
            <link>https://medium.com/@berlinnn3388/%E7%BE%8E%E5%9C%8B%E7%95%99%E5%AD%B8-2026-spring-cmu-mscv-2nd-semester-a0f35961953f?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0f35961953f</guid>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Tue, 12 May 2026 08:41:38 GMT</pubDate>
            <atom:updated>2026-05-13T10:36:29.767Z</atom:updated>
            <content:encoded><![CDATA[<h3>前言</h3><p>上學期寫了一篇心得得到很多迴響，想說又到了期末也來記錄下 2026 Spring Semester 留學體驗！回顧起來上學期都在醞釀的階段，而這學期終於比較有開花結果。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uar5DshWt_WLdpBVkwnN5A.png" /><figcaption>春天的 GHC</figcaption></figure><h3>課業</h3><p>這學期有三堂課，但是 Capstone 算一個所以只有另外一個必修和一個選修。前半個學期的課業很涼，和周遭其他 CMU 的同學比過得很好哈哈，但到期末三個專題加在一起壓力非常大。</p><h4>16833: Robot Localization and Mapping</h4><p>Time Spent: 82 hr = 43 (Lecture + HW) + 39 (Project)</p><p>RI 開的必修 (和 16–822 Geometry-based Methods in CV 二選一)，老師是 SLAM 領域的神人兼系主任 Michael Kaess，講課很認真，常常數學會親自慢慢推導！體感很慢導致大家都看網課，讓 Michael 很難過。</p><p>作業不會很難，主要是理論推導 + 實作完的結果和解釋，讓常常落課的我還是能學到核心的概念。不過到後面期末很忙，最後我就只求低空飛過了。</p><p>- HW1：Particle Filters<br>- HW2：EKF + SLAM<br>- HW3：Linear &amp; Nonlinear SLAM Solvers<br>- HW4：Dense SLAM with Point-based Fusion<br>- Final Project：Proposal + Oral Presentation + Report</p><h4>Final Project</h4><p><strong>LiDAR Robustness in Degraded Environments<br></strong><a href="https://docs.google.com/presentation/d/1yl26n89UJUFLgUm-Th0TTK8ETb3G4E8cr3IVrEzWOxY/edit?usp=sharing">Presentation</a> / <a href="https://drive.google.com/file/d/1WDMGdbpeQxBpRFpo_YokVYdDqMt0SOb6/view?usp=drive_link">Report</a> / <a href="https://github.com/berlin0308/Degraded-LiDAR-Inertial-SLAM">Code</a></p><p>原本想做火場濃煙下的 SLAM，用 RGB 偵測壞掉的 LiDAR 把他踢除，然而根本找不到像樣的 Dataset (<a href="https://superodometry.com/datasets">ICCV 2023 SLAM Challenge</a> 缺好多資料)。最後我做的是 SLAM 跑在新找到的 Dust Dataset，剔掉壞掉的點再送進去 SLAM (但其實缺 IMU 跑出來很怪)；另一部分組員有分析如何丟掉壞掉的點，還有如何透過 Adaptive Covariance 來維持整個地圖。</p><p>到期末了還是一蹋糊塗，反正最後上台報告和書面就交差了事～這堂課的組員比較隨性，而我也沒特別對 SLAM 有興趣哈哈哈就當作使用划水體驗券。主要的心得是 SLAM 即使是最主流的 Dataset 也是參差不齊，資料損壞或缺 Sensor 都很常見… 以及學會放下完美主義，理解划水練習划水。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5JpgXwolBxtCMnh196ItKA.png" /><figcaption>A: LiDAR Dataset with Dust, B: Estimated Trajectory, C: LiDAR Frame Dropping</figcaption></figure><h4>15642: Machine Learning Systems</h4><p><a href="https://mlsyscourse.org/schedule">Course Website</a> / Time Spent: 99 hr = 34 (Lecture + HW) + 65 (Project)</p><p>繼上學期修 10–714 DL Systems 現在來修 ML Systems，有先修規定可是寄了信很快就批准了。這堂課雖然沒有前者有名氣 (因為才開第三年)，但我認為對我更加有用！很成功有系統地拾回 Systems 層面需要的知識，也非常跟得上時代！可以跟到現在主流 LLM 系統最新的技術。</p><p>前三分之一講基礎 ML 框架、GPU Programming 都算和 10–714 重疊，中間講到 ML Parallelization 對大型 LLM 系統很重要；講到 ML Compiler 可以體會到小小的 GEMM 可以優化到什麼境界 (Memory Layout、Swizzling、TMA)，然後作業就會用老師自家研發的 TIRx (ML Compiler DSL) 在 Blackwell 做十種 GEMM。</p><p>不過最精華的還得是 LLM Serving。畢竟現在需求很高、找工需要，最熱門的 vLLM、SGLang 必定需要像是 Continuous Batching、PagedAttention、RadixAttention 來有效管理 KV Cache 之類的。課程最後面都是 Advanced Topic，有興趣再去聽就可以。作業不會花到很多時間，可以花多些時間在 Final Project。</p><p>- HW1：Automatic Differentiation<br>- HW2：Distributed Training<br>- HW3：GEMM with TIRx on Blackwell<br>- Final Project：Proposal + Poster + Report</p><h4>Final Project</h4><p><strong>Efficient 3D Perception Inference Pipeline<br></strong><a href="https://drive.google.com/file/d/1fXnjaf4vMVd2UaAQJZEoZNA3JLdxRSbo/view?usp=sharing">Poster</a> / <a href="https://drive.google.com/file/d/1WDMGdbpeQxBpRFpo_YokVYdDqMt0SOb6/view?usp=sharing">Report</a> / <a href="https://github.com/berlin0308/3D-Perception-Pipeline-Optimization">Code</a></p><p>我一直都很想做的主題，剛好學期初遇到 RI 的學姐就找來做 (RI 之外大概不會對 Point Cloud 有興趣… 幾乎全是 LLM 人)。</p><p>我們想對一個主流的 PyTorch LiDAR Point Cloud Detection 框架去探索可以優化多少 PointPillars 效能，其中比較了 Baseline、Operator Fusion &amp; Overhead Reduction (Compiler)、Memory Layout Optimization、GPU Voxelization、TensorRT。也有分析在多種量級 GPU 和多種 Precision (FP32、AMP、FP16) 的表現，親自解答了很多好奇的問題！也很幸運遇到溫暖又高效率的組員，第一次沒人消失的 Project！</p><p>Takeaway 包括 TensorRT 已經很高度優化 (果然是 NV 工程師)、軟體層優化對爛硬體尤其有效果 (反映自駕感知的需求)、Perception + Systems 交集的欠開發 (Systems 人不理解 Perception 需求)、如何權衡多項指標等等。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tF7EXLku2T8GQEIL0ijmNg.png" /><figcaption>A: PointPillars Pipeline, B: Latency Breakdown, C: Accuracy-Latency-Energy Pareto Frontier</figcaption></figure><h4>16621: MSCV Capstone</h4><p><strong>Multi-Modal Synthetic Data Generation and Fusion for Adverse Driving Scenarios (Prof. Matthew O’Toole &amp; Oshkosh)<br></strong><a href="https://mscvprojects.ri.cmu.edu/2026teamf2/">Website</a> / <a href="https://drive.google.com/file/d/1hd1qYCC0LOcmLr-_RnXAwuAGv8BGknfn/view?usp=sharing">Poster</a> / <a href="https://drive.google.com/file/d/1Lcf3i47s98a7_Q77HtUwA55u4lnCsMsV/view?usp=sharing">Video</a> / Time Spent: 194 hr (時間黑洞)</p><p>Capstone 是 2–4 人一組，我們組就我和另一個大陸人，每兩週同時跟教授 Matt 和企業方 Meeting。但其實我的組員、教授、企業方都挺隨性的，原本期待可以有個明確的研究方向，但第一週我就知道我得自己帶方向，整個學期都很積極推進度，可惜還沒達到理想的樣子就要期末、得開始趕報告，只好下學期繼續努力！</p><p>回顧起來真的花了很多時間，但其實八成左右的工程量都沒有用，有些做一做行不通、有些怎麼訓練都是沒有效果，也讓我體驗到我即使有 AI 沒有教授帶研究方向還是很容易瞎做，也促使我下學期打算把這題目導向教授專長的主題！希望可以利用教授的專業學到更多！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmq1x1n4e3DPkfeKzDPODw.png" /><figcaption>A: Synthetic Data Generation with Cosmos-Transfer, B: Camera-LiDAR-RADAR Fusion, C: Generated Driving Scenarios, D: Improved RADAR Processing</figcaption></figure><p>- 2025/11/7：Project Pitch (教授/企業講解題目) &amp; 排志願<br>- 2026/1/8：公布題目分配 (選到第 2 / 21)<br>- 2026/1/11：26 Spring 開學<br>- 2026/1/30–5/1：每兩週咪一次<br>- 2026/2/13：Oral Presentation (被排到第一個報告…)<br>- 2026/4/24：Poster Presentation<br>- 2026/5/7：Website &amp; Video Presentation</p><h3>找工</h3><p>原本期待第一個學期趕快上岸就可以放飛，結果一直沒找到直到三月多… 但還好不是硬控到底，而且就最後有拿到 Offer 來說算是值得的經驗。</p><p>上學期 (2025 Fall) 只拿到兩個面試還是很打擊的，不料寒假和春季開學爆發一堆面試！！很慶幸上學期有提升能力也有把不錯的 Project 放上履歷，當然部分是春季景氣解凍一點、新創開始招人，總之自信心撿回來一大塊。</p><p>最終雖然還是回了台灣外商，這次美國求職就當作折磨又難得的洗禮。2026 年找 Intern 真的很難，但還是看到不少厲害同學在美國上岸，大不了就跟我一樣進台灣外商，或是去美國台商，直接不找直接進實驗室也是好選擇。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*no5sf6irngaPiUcnor0Y6Q.png" /><figcaption>2025/8–2026/3 找實習總結</figcaption></figure><h3>課外 Project</h3><h4>Assistive AI Glasses for People Living with Dementia</h4><p><a href="https://devpost.com/software/ourlife?ref_content=user-portfolio&amp;ref_feature=in_progress">Website</a> / <a href="https://github.com/VictorChenCA/RealityHacks26-OurLife/">Code</a> / <a href="https://youtu.be/WmoVE9kZoc0?si=IewsjPdvnRTj3Qls">Video</a></p><p>學期初去 <a href="https://www.realityhackatmit.com/">MIT Reality Hack 2026</a> (XR 領域很大的黑客松) 找到了想一起開發 Meta Ray-Ban 眼鏡的隊友！在腦力激盪過後因為眼鏡有獲取日常 Context 和提醒的功能，我們選擇聚焦於可以幫助失智者的眼鏡，可以根據使用者時間/地點給予提醒、辨識人物、提示過去回憶等等。</p><p>最後在短短三天內完成了一個 Demo 並拿到 Meta 的大獎！我負責的部分是 Meta Ray-Ban 核心的軟硬體整合，利用 <a href="https://developers.meta.com/wearables/notify/">Meta Wearables Device Access Toolkit</a> 建立從眼鏡捕捉影像、語音辨識、連接後端、iOS 介面到語音播放的流程；其他組員做 GCP 後端 (Gemini、RAG)、Unity 開發、UI/UX 等等。</p><p>黑客松結束後我們還有繼續做，報了 <a href="https://about.fb.com/news/2026/01/ai-glasses-impact-grants-wearable-technology-for-good/">Meta AI Glasses Impact Grant</a> 也寄了上百封的合作邀請信，勉勉強強得到幾個聯繫，真的是深刻體會到人脈的重要… 後來報上了 Berkeley 的 <a href="https://imprint.berkeley.edu/">IMPRINT Scholars Program</a>。</p><p>我也找了醫學系同學和北榮的權威醫師來訪談，得到很寶貴的 Domain Knowledge 和建議～問完其實有點迷茫，但也更認知到科技的限制和試辦研究的過程 (但也要先有錢才能安排)。</p><p>老實說當初黑客松社交能量見底時超級後悔！但以現在來說很慶幸當時自己推了自己一把，才走出舒適圈、認識厲害有想法的人、體驗到新創的過程。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ge5Ev2fDyz1BQryHvXx-kg.jpeg" /></figure><h4>BMP ‘26</h4><p>最近聽到各種好消息很高興！曾經幫助過的學弟妹都錄取了理想的學校，也很多決定來敝校，期望大家以後都可以飛黃騰達然後內推我！</p><p>既然認識超多新生，看看開學前能不能把大家湊起來彼此認識，成為下一個 Mason，也期待可以延續這樣的 Mentorship 文化～我應該還會繼續辦 BMP’27 (預計 2027 入學/2026 年底申請)，規模可能有限，但歡迎推薦學弟妹給我！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i27FNNXGUJ1ctK9SNkY1nQ.png" /><figcaption>好人做到底，家產持續整理中，歡迎學弟妹來跟我要</figcaption></figure><h3>生活</h3><p>寫心得的當下發現這學期很少生活：前半學期找工焦慮，三月有 Offer 之後心態比較輕鬆，但不久後又進入期末地獄… 最多的時候就是中午出門找間咖廳 → 打開電腦做事 → 傍晚回家煮晚餐 → 繼續工作到半夜。這樣的確滿足理想中的彈性生活，只是不去上課還是會有脫節感、遇不到同學。</p><p>在匹茲堡的日子總是忙碌，好在有把握機會往外跑：開學前去了西雅圖、學期初去波士頓、還玩了兩趟紐約。每一趟旅行都令人印象深刻，得到很多人生的啟發！</p><p>坦白說對於生活，來到美國我有了和過往全然不同的理解。雖然工作狂基因如我還無法完全領悟認真生活的本質，但現在我學會練習經營生活，也向心目中理想的工作/生活模式傾斜，漸漸擁有了自己人生的掌控感。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vTWDZs35_Lz8JY6XrCR0XA.png" /><figcaption>第一個在國外過生日</figcaption></figure><h3>總結</h3><p>相比於第一個學期的連滾帶爬，這學期總算有站穩腳步做了很多事！找到實習、體驗新創、去了美國其他城市，更重要的是更加認識自己和清楚未來的發展方向。</p><p>暑假回台灣度假了！期待下一篇心得分享。</p><h3>Appendix</h3><h4>其他心得分享</h4><blockquote><em>- </em><a href="https://medium.com/@berlinnn3388/%E7%BE%8E%E5%9C%8B%E7%95%99%E5%AD%B8-2025-fall-cmu-mscv-%E5%B0%B1%E8%AE%80%E9%AB%94%E9%A9%97-b75d01d5e7fe"><em>美國留學 | 2025 Fall | CMU MSCV 1st Semester</em></a><em><br>- 美國求職 | 2026 Summer | 北美 SWE/MLE 找實習<br>- (面試準備) </em><a href="https://medium.com/@berlinnn3388/ml-systems-optimization-from-algorithm-to-silicon-4ae4dc434182"><em>ML Systems Optimization: A Software Engineer’s Perspective</em></a><em><br>- (面試準備) </em><a href="https://medium.com/@berlinnn3388/%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-%E9%9D%A2%E8%A9%A6%E6%9C%83%E7%94%A8%E5%88%B0%E7%9A%84-c-c-8770d03f551c"><em>學習筆記 | 面試會用到的 C++</em></a><em>、</em><a href="https://medium.com/@berlinnn3388/%E6%BC%94%E7%AE%97%E6%B3%95%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-graph-b2ef856f28e0"><em>學習筆記 | Graph</em></a><em>、</em><a href="https://medium.com/@berlinnn3388/%E6%BC%94%E7%AE%97%E6%B3%95%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-binary-search-df741059c592"><em>學習筆記 | Binary Search</em></a></blockquote><h4>匹茲堡讀書咖廳</h4><blockquote><em>- Mechanic Coffee Company (16:00 關)<br>- Redstart Roasters (環境超悠閒採光好)<br>- Starbucks (可以讀到 20:00)<br>- Delanie’s Coffee, Centred Coffee &amp; Wellness, Yinz Coffee</em></blockquote><h4>學生社群</h4><blockquote><em>- </em><a href="https://www.facebook.com/groups/tsstaiwan/"><em>TSS in Pittsburgh</em></a><em><br>- </em><a href="https://www.facebook.com/tsacmu"><em>Taiwanese Students Association (CMU)</em></a><em><br>- </em><a href="https://www.facebook.com/groups/781347202226425?locale=zh_TW"><em>梅森北美校友會</em></a><em><br>- </em><a href="https://www.facebook.com/NTUAAPittsburgh"><em>匹茲堡台大校友會</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0f35961953f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Systems Optimization: A Software Engineer’s Perspective]]></title>
            <link>https://medium.com/@berlinnn3388/ml-systems-optimization-from-algorithm-to-silicon-4ae4dc434182?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ae4dc434182</guid>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Sun, 18 Jan 2026 05:15:36 GMT</pubDate>
            <atom:updated>2026-05-13T10:37:26.478Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>This article is a comprehensive notebook of my takeaways from these three world-class courses:</p><ol><li><strong>CMU 10-714 (Deep Learning Systems: Algorithms and Implementation)</strong></li><li><strong>CMU 15-642 (Machine Learning Systems)</strong></li><li><strong>MIT 6.5940 (TinyML and Efficient Deep Learning Computing)</strong></li></ol><p>Let’s introduce my 5-layer framework:</p><ol><li><strong>Reduce Computation / Model (MIT 6.5940): </strong>Lower FLOPs, parameters, and memory footprint through pruning, quantization, distillation, and efficient architecture design.</li><li><strong>Rewrite Computation / Compiler (CMU 10–714):</strong> Leverage graph rewrites, operator fusion, IR lowering, and auto-scheduling to transform high-level graphs into hardware-optimized execution plans.</li><li><strong>Execute Efficiently / Kernel &amp; Runtime (CMU 15–642)</strong>: Optimize memory access patterns, parallelism, kernel scheduling, and runtime dispatch to eliminate bottlenecks at the device level.</li><li><strong>Scale Efficiently / Distributed (CMU 15–642): </strong>Design parallelism strategies and communication patterns that balance compute, memory, and network constraints.</li><li><strong>Orchestrate at Scale / Infrastructure</strong>: Coordinate models, requests, and resources in production environments.</li></ol><p>I hope this integrated framework provides a clear and helpful roadmap for your journey!</p><h3>I. <strong>Reduce Computation / Model</strong></h3><h4><strong>1 — 1. Pruning</strong></h4><p><strong>Pruning removes unnecessary parameters</strong> from a trained model to reduce computation and memory while preserving accuracy.</p><p>Personally I recommend learning this through <a href="https://hanlab.mit.edu/courses/2024-fall-65940"><strong>MIT 6.5940</strong></a><strong> </strong>which provides a clear intro to model compression and covers state-of-the-art techniques developed by the <a href="https://hanlab.mit.edu/">MIT Han Lab</a>.</p><p>Its effectiveness depends on <strong>[1]</strong> <strong>Granularity, [2] Importance Criteria, and [3] Pruning Ratio</strong>.<strong> </strong>To elaborate:</p><ul><li><strong>[1] Granularity<br>- Fine-grained Pruning:</strong> very high sparsity but limited hardware acceleration due to irregular memory access.<br>- <strong>Pattern-based Pruning:</strong> commonly in the form of N:M sparsity (<a href="https://developer.nvidia.com/blog/accelerating-inference-with-sparsity-using-ampere-and-tensorrt/">Sparse Tensor Cores: hardware acceleration of 2:4 sparsity</a>). Generally better accuracy–efficiency trade-off.<br>- <strong>Channel Pruning: </strong>direct speed up while lower compression ratio and potential accuracy drop if over-pruned.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mnh7TLyH9foLAu0RL72H4Q.png" /><figcaption>Granularities in pruning</figcaption></figure><ul><li><strong>[2] Importance Criteria:<br>- Magnitude-based pruning</strong> assumes small weights are less important (L1/L2/Lp norms).<br>- <strong>Channel scaling factors</strong> (e.g., BatchNorm γ) identify unimportant channels.</li><li><strong>[3] Pruning Ratio:<br>- </strong>Non-uniform pruning ratios assign different sparsity per layer based on <strong>sensitivity</strong> (assumes no inter-correlated).<br>- Methods like <a href="https://arxiv.org/abs/1802.03494"><strong>AMC: AutoML for Model Compression</strong></a> and <a href="https://arxiv.org/abs/1804.03230">NetAdapt</a> <strong>automatically find optimal pruning ratios</strong> to balance accuracy and FLOPs.</li></ul><h4>1–2. Quantization</h4><p>Quantization accelerates inference and reduces memory footprint by mapping high-precision values (e.g., FP32) to lower-precision formats (INT8, FP8, FP4), while attempting to preserve model accuracy.</p><p>What to quantize:</p><ul><li><strong>Weight-only quantization (INT Weights + FP Compute):</strong> weights are stored in low precision but dequantized to floating point during computation. e.g. <strong>K-means–based weight quantization</strong> clusters weights to reduce storage (effective for <strong>LLMs</strong>, where memory bandwidth is the primary bottleneck).</li><li><strong>Quantization with true acceleration</strong> <strong>(INT Weights + INT Compute)</strong> includes <strong>Linear Quantization: r = S (q — Z)</strong> (S: scaling factor, Z: zero point).</li></ul><p>Quantization paradigms in practice:</p><ul><li><strong>Post-Training Quantization (PTQ): </strong>models can be fine-tuned after PTQ to recover accuracy.</li><li><strong>Quantization-Aware Training (QAT): </strong>simulates quantization during training using the Straight-Through Estimator (STE).</li><li><strong>Mixed-Precision Quantization </strong>use different bit-widths for different layers based on sensitivity. Automated methods like <a href="https://arxiv.org/abs/1811.08886">HAQ (Hardware-Aware Automated Quantization)</a> automatically selects bit-widths under hardware constraints.</li></ul><h4><strong>1–3 Neural Architecture Search (NAS)</strong></h4><p>NAS automates model design by searching over architectural choices such as width, depth, kernel size, and input resolution, rather than manually tuning them.</p><p>Modern NAS is often <strong>hardware-aware</strong>, explicitly optimizing for latency, energy, or memory on target devices (e.g. mobile devices prefer deep &amp; narrow models; GPUs prefer shallow &amp; wide models).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*bRm6M7OuRsjVL5sRnX6H8g.png" /></figure><p>Recent frameworks like <strong>Once-for-All (OFA)</strong> train a single over-parameterized network from which <strong>sparsely-activated sub-networks</strong> can be extracted for different hardware platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*o5eg2sIK-b0p5MdFfyyu0A.png" /></figure><h3>II. <strong>Rewrite Computation / Compiler</strong></h3><p>At deployment time, machine learning models are translated from <strong>high-level compute graphs</strong> into <strong>hardware-specialized machine code.</strong></p><p>Personally, I highly recommend <a href="https://mlc.ai/summer22/"><strong>Machine Learning Compilation</strong></a><strong>, </strong><a href="https://mlsyscourse.org/schedule"><strong>CMU Machine Learning Systems</strong></a><strong>, and </strong><a href="https://dlsyscourse.org/"><strong>CMU Deep Learning Systems</strong></a> courses taught by Professor Tianqi Chen<strong> </strong>(founder of TVM, OctoML, and MLC LLM).</p><p>My key takeaway is that high performance is no longer achieved solely through manual kernel engineering, but through frameworks that systematically translate high-level models into hardware-efficient execution.</p><p>The <strong>ML compilation</strong> process includes:</p><ol><li><strong>Parse Model Semantics</strong> (Frontend): Read exported model formats <strong><em>(ONNX, TorchScript, SavedModel)</em></strong> to construct high-level computation graphs.</li><li><strong>Optimize Execution Strategies</strong> (Middle-end): Decide how computations are carried out efficiently. Different ML compilers <strong><em>(TVM, MLIR)</em></strong> operate on different <strong>IRs <em>(Tensor IR, TOSA, StableHLO)</em> </strong>and different optimization strategies.</li><li><strong>Generate Hardware-Specific Code</strong> (Backend): Transform optimized IR into executable code for a specific device <strong><em>(LLVM, NVCC, Vitis).</em></strong></li></ol><h4>ML Compilers</h4><p>ML compilers <strong><em>(TVM, MLIR)</em></strong> bridge model formats (ONNX, TorchScript, SavedModel) and hardware-specific code. Models are first lowered into <strong>intermediate representations (IRs)</strong> <strong><em>(Tensor IR, TOSA, StableHLO)</em></strong>, where compilers conduct <strong>graph/high-level transformations: operator fusion </strong><em>(reduces memory traffic)</em>, <strong>subgraph extraction</strong> <em>(isolates reusable subgraphs)</em>, <strong>branch simplification</strong> <em>(rewrites statically known branches)</em>, <strong>constant folding</strong> <em>(precomputes operations on known constants)</em>, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ht3y49ECcp214t9upjFKdw.png" /><figcaption>An Example of Graph Optimization. (<em>Source: CMU 15–642 Machine Learning Systems, Prof. </em>Tianqi Chen)</figcaption></figure><p>These graphs are then lowered and thus enable <strong>low-level transformations: tiling</strong> <em>(improves data locality &amp; cache reuse)</em>, <strong>loop reordering</strong> <em>(makes memory accesses contiguous)</em>,<strong> loop unrolling</strong> <em>(reduces loop control overhead &amp; increases instruction-level parallelism)</em>, <strong>vectorization</strong> <em>(data-level parallelism using SIMD)</em>, <strong>mapping to hardware intrinsics</strong> <em>(Intel VNNI, AVX, NVIDIA Tensor Core MMA)</em>, etc.</p><p>A single operator admits many valid implementations/variants, creating a large search space for performance tuning. <strong>TVM</strong> features <strong>Auto Schedulers</strong> (AutoTVM/Ansor/MetaScheduler) to automate this process using search and XGBoost-based learning, empirically identifying the fastest schedule for a given hardware target. As a result, TVM excels at <strong>portability</strong>: the same model can be recompiled and re-optimized for GPUs, CPUs, or specialized accelerators without manual kernel rewriting.</p><h3>III. <strong>Execute Efficiently / Kernel &amp; Runtime</strong></h3><p>After the model is compressed and the graph is compiled, performance is no longer theoretical. It is determined by <strong>how efficiently kernels execute</strong> on hardware and <strong>how the runtime orchestrate</strong>s them.</p><p>Performance engineering of ML systems requires understanding computer architecture and OS behaviors.</p><p>My step-by-step workflow to approach systems optimization:</p><ol><li><strong>Built in optimized mode </strong>(e.g. enable compiler optimizations, specify GPU architecture). <br><strong>*Use existing CUDA libraries when possible </strong>(e.g. cuBLAS, cuDNN, CUTLASS, TensorRT that are heavily tuned by NVIDIA engineers)</li><li><strong>Measure </strong>system performance<strong> </strong>with profilers (e.g. Nsight Systems, Nsight Compute, Torch Profiler).</li><li><strong>Propose </strong>hypothesis of a possible bottleneck (e.g. memory-bound, compute-bound, overhead).</li><li><strong>Apply</strong> targeted fixes (e.g. improve memory layout, use Tensor Cores, trace computation, adjust block size).</li><li><strong>Re-measure</strong> system performance to possibly verify the hypothesis, debug, debug, and debug through 3.–5.</li><li><strong>Iterate</strong> until performance stabilizes.</li></ol><p>In the following chapters, I will do my best to explain the methods and tools that are useful for understanding and troubleshooting throughout 3. — 5, which is super frustrating for me as a beginner.</p><h4>3–1. Bottleneck Taxonomy</h4><p>Please refer to <a href="https://horace.io/brrr_intro.html">this article</a> to understand the 3 major components in DL systems: compute, memory, and overhead.</p><p>Use this checklist to identify common performance issues and their fixes:</p><p><strong>High Memcpy</strong></p><ul><li><strong>Cause:</strong> Many small copies, frequent Unified Memory migrations</li><li><strong>Fix: </strong>Merge copies, use pinned memory (page-locked memory to speed up CPU↔GPU transfer), overlap streams, cudaMemPrefetchAsync</li></ul><p><strong>DRAM Busy but Low FPS</strong></p><ul><li><strong>Cause:</strong> Memory-bound</li><li><strong>Fix:</strong> Improve memory layout to ensure <strong>coalesce memory accesses</strong> (NCHW, NHWC), shared memory, data reuse, operator fusion (torch.jit, NVFuser, XLA, Triton, TVM)</li></ul><p><strong>High FPS (near peak FLOPS) but Slow</strong></p><ul><li><strong>Cause:</strong> Compute-bound</li><li><strong>Fix:</strong> Apply optimized libraries (cuBLAS/cuDNN), lower precisions (INT8/FP16), use Tensor Cores, upgrade GPUs</li></ul><p><strong>All Not Busy</strong></p><ul><li><strong>Cause:</strong> Overhead-bound<strong> (</strong>Python interpreter -&gt; PyTorch -&gt; launch dispatched kernel)</li><li><strong>Fix: </strong>Trace the computation into a static graph (torch.jit.trace, jax.jit) though it may limit flexibility (TorchDynamo supports dynamic graph)</li></ul><p><strong>Warp Stalls</strong></p><ul><li><strong>Cause:</strong> Excessive synchronization</li><li><strong>Fix:</strong> Reduce synchronization frequency, aggregate locally</li></ul><p><strong>Low Occupancy </strong>(Few active warps per SM → faster thread execution but expose latency)</p><ul><li><strong>Cause:</strong> Too many registers or shared memory per block</li><li><strong>Fix:</strong> Adjust block size, reduce registers/shared memory usage</li></ul><p><strong>Inconsistent Timing</strong></p><ul><li><strong>Cause:</strong> System noise, temperature, dynamic clock throttling</li><li><strong>Fix:</strong> Average multiple runs, warm up</li></ul><h4>3–2. Performance Models</h4><p>Performance optimization should not rely solely on trial-and-error debugging. To reason about bottlenecks systematically, we need simplified analytical models that explain why a workload behaves the way it does.</p><p>Classic models include <strong>[1] Roofline, [2] Amdahl’s Law </strong>and<strong> [3] Little’s Law</strong></p><p><strong>[1] Roofline</strong> is a visual model for understanding performance bottlenecks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*VEUao-OMYerUw0KQ.png" /><figcaption>Source: Hierarchical Roofline Performance Analysis for Deep Learning Applications</figcaption></figure><ul><li>In the plot, the slanted line represents the <strong>memory bandwidth</strong> <strong>limit</strong>, where performance scales with operational intensity and the workload is <strong>memory-bound</strong>. The horizontal line represents the <strong>peak compute limit,</strong> where performance no longer increases with intensity and the workload becomes <strong>compute-bound.</strong></li><li>If a workload is memory-bound, performance improvements should focus on improving memory layout or moving reused data from global memory into shared memory <strong>(shifting the bandwidth roof upward)</strong>. If a workload is compute-bound, optimization efforts should target increasing parallelism, applying lower precisions, or leveraging specialized hardware such as Tensor Cores <strong>(shifting the compute roof upward)</strong>.</li></ul><p><strong>[2] Amdahl’s Law</strong> explains that the overall speedup of a system is <strong>limited by its sequential components.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*gTVoovkZs3ovVCSa.png" /><figcaption>Source: <a href="https://www.manning.com/books/grokking-concurrency?utm_source=luminousmen&amp;utm_medium=affiliate&amp;utm_campaign=book_bobrov_grokking_5_18_22&amp;a_aid=luminousmen&amp;a_bid=4e810762">Grokking Concurrency</a></figcaption></figure><ul><li>For example, even with highly optimized GPU parallel computation, stages such as pre-processing, post-processing, and device synchronization can dominate end-to-end performance.</li><li>CV-CUDA addresses this by moving traditional CPU pre- and post-processing <strong>onto GPU</strong> and enabling <strong>zero-copy</strong> data flow, which leads to better end-to-end performance.</li></ul><p><strong>[3] Little’s Law</strong> reveals a fundamental constraint in inference systems</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*QKZXa5yZz46tg__s" /></figure><p>Thus, serving optimization can target:</p><ul><li>Reducing service time W (kernel/runtime optimization)</li><li>Increasing capacity L_max (parallelism, replication)</li><li>Controlling arrival rate λ (rate limiting, load shedding)</li></ul><p>But… what is the objectives when evaluating system performance? One key aspect is understanding the <strong>latency-throughput trade-off</strong>: high throughput often relies on batching and asynchronous multi-stream processing, which can increase latency.</p><ul><li><strong>Autonomous Vehicles &amp; Robotics:</strong> low and predictable <strong>latency </strong>(p99 latency) is critical.</li><li><strong>Data Center &amp; Cloud: </strong>maximizing <strong>throughput</strong> with large batches, GPU saturation, and aggressive asynchronous execution is typically more important.</li></ul><h4>3–3: Runtime Inference Systems</h4><p>Modern inference engines <strong><em>(TensorRT, OpenVINO, XLA, ONNX Runtime, TFLite)</em></strong> package these three stages into a single system.</p><p>They focus on executing <strong>static, known graphs </strong>efficiently. They load exported models, pre-allocate memory, fuse operators, and dispatch execution through highly optimized kernels.</p><p>The trade-off is<strong> flexibility</strong>. Supported operators and programming models are constrained, and dynamic behaviors (e.g., conditional routing or sub-experts) are often limited.</p><h4>3–4: Kernel DSLs</h4><p>Kernel DSLs (Domain Specific Languages) effectively expose the compiler’s middle-end to developers, allowing <strong>explicit control</strong> over scheduling, tiling, and memory layout <strong>without dealing with raw PTX or assembly.</strong></p><p><strong>Triton</strong> takes a more direct approach by exposing a <strong>Python-based kernel DSL</strong> that allows developers to explicitly control how computation maps onto GPU hardware. Triton kernels resemble CUDA in spirit, but abstract away many low-level details such as thread indexing and synchronization.</p><p>This design makes Triton particularly effective for <strong>performance-critical kernels</strong> like matrix multiplication and attention, where fine-grained control over memory access and parallelism is essential.</p><h3>IV. <strong>Scale Efficiently / Distributed</strong></h3><p>Efficient inference goes beyond model design and compiler optimizations. At scale, the core challenges are <strong>managing multiple models, requests, and devices</strong>, handling throughput vs. latency trade-offs, and coordinating compute, memory, and network resources.</p><h4><strong>Parallelism</strong></h4><p>Modern frameworks (like <strong>NCCL</strong>) often support parallelism techniques like:</p><ul><li><strong>Data Parallelism</strong> (splits data, replicates model): Useful for large datasets; limited by memory bandwidth &amp; sync overhead; Collective ops include <strong><em>AllReduce</em></strong><em> </em>(gradient aggregation), <em>AllGather</em>, <em>Reduce-Scatter</em>, etc.</li><li><strong>Model Parallelism</strong> (splits model, replicates data): Useful for very large models; requires careful partitioning to balance computation and inter-device communication</li><li><strong>Pipeline Parallelism</strong> (splits model, splits data): Keep pipeline busy by processing mini-batches across model stages</li><li><strong>Tensor Parallelism</strong> (splits tensor op): Useful for large transformer models; needs advanced partitioning algorithms and high bandwidth</li><li><strong>Zero Redundancy Optimizer </strong>(splits optimizer states, gradients, and parameters): Reduces memory redundancy; complex implementation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cXxiPhKuQ-_pV22n" /><figcaption>Two Major Paradigms: Data Parallelism &amp; Model Parallelism (<a href="https://www.linkedin.com/pulse/parallelism-ai-subramaniyam-pooni-dyhjc/">Source</a>)</figcaption></figure><h4>Efficient LLM Serving Systems (vLLM, SGLang)</h4><p><strong>KVCache</strong> is a foundational building block of modern LLM serving systems. It stores past attention states so the model can generate new tokens efficiently without excessive re-computation (<a href="https://www.modular.com/blog/the-five-eras-of-kvcache">The Five Eras of KVCache</a>).</p><p><strong>vLLM </strong>uses <strong>PagedAttention</strong> to manage KV cache memory. It partitions the KV cache of each sequence into smaller, more manageable <strong>pages</strong> or <strong>blocks.</strong> The logical blocks are mapped to non-consecutive physical blocks using a block table. This prevents fragmentation (due to unknown, different lengths) and allowing multiple requests or users to share memory blocks efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyCjlZakrvcG5u9h_6WLTw.png" /></figure><p>vLLM also supports <strong>speculative decoding</strong>, where a tiny Draft Model to quickly generate text and a large Oracle Model to verify those tokens in a single parallel step.</p><p>Similary, <strong>SGLang</strong> uses CUDA Virtual Memory APIs to dynamically remap device memory and unify different KV regions.</p><h4><strong>TensorRT/OpenVINO: Inference Engines</strong></h4><p><strong>TensorRT</strong> and <strong>OpenVINO</strong> are more than model optimizers — they are full inference engines. <strong>TensorRT</strong> generates multiple <strong>tactics</strong> per layer during compilation, benchmarking and caching the fastest kernel per input shape. It manages dynamic shapes, concurrent request streams, and execution order to maximize GPU utilization and throughput. <strong>OpenVINO</strong> supports <strong>heterogeneous device execution,</strong> automatically profiling layers to assign them to CPU, iGPU, or VPUs. It handles layer-to-device mapping, kernel dispatch, and memory planning at runtime, supporting batching, concurrency control, and efficient multi-request scheduling. Together, they bridge the gap between optimized models and production deployment.</p><h3><strong>V. Orchestrate at Scale / Infrastructure</strong></h3><h4>Triton/Ray/TorchServe: Serving</h4><p>When multiple requests, models, or GPUs must be coordinated, serving and scheduling systems become essential. <strong>Triton, Ray Serve, TorchServe</strong> tackle the challenges of dynamic batching, priority scheduling, and concurrency control in different ways.</p><h4><strong>Large-Scale </strong>Infrastructure</h4><p>At large scale, performance bottlenecks often shift from individual kernels to system-level constraints. Efficient execution requires coordinating compute, scheduling, containers, and storage across many nodes.</p><p><strong>Containerization</strong> is essential for reproducibility and deployment consistency. <strong>Docker</strong> is widely used to package ML environments with CUDA and dependencies, while HPC environments typically rely on <strong>Singularity</strong> or <strong>Apptainer</strong> due to their <strong>rootless execution</strong> model and tighter security guarantees.</p><p><strong>Network Topology and Communication</strong> at scale is also important. As systems scale, performance is increasingly limited by data movement rather than raw compute. Even within a single node, <strong>NUMA locality (CPU–memory affinity) and GPU topology (NVLink &gt; PCIe &gt; cross-socket PCIe)</strong> can significantly impact scalability and runtime performance, as poor locality introduces additional latency and reduces effective bandwidth.</p><p>At multi-node scale, <strong>network bandwidth and latency</strong> — especially with <strong>InfiniBand and RDMA (Remote Direct Memory Access)</strong> — often dominate collective communication costs. Operations such as <em>AllReduce</em> and <em>AllGather</em> are highly sensitive to topology, making node placement and topology-aware communication critical for achieving efficient distributed performance.</p><p><strong>Storage </strong>also frequently becomes the dominant bottleneck. Large clusters rely on networked (NFS) or parallel (Lustre) file systems, where throughput and metadata operations are shared across users. Inefficient <strong>access patterns</strong>, <strong>excessive small-file operations</strong>, or <strong>frequent checkpointing</strong> can severely limit end-to-end performance.</p><p>To manage shared cluster resources, <strong>job schedulers</strong> such as <strong>Slurm</strong> allocate nodes, GPUs, CPUs, and memory to jobs. Concepts like partitions, nodes, and tasks determine how workloads are placed and executed. Suboptimal scheduling decisions — such as poor NUMA locality or GPU topology — can significantly impact scalability and runtime performance.</p><h3>Final Notes</h3><blockquote><em>“Every single layer of the technology stack has been transformed… in just 12 years.” — Jensen Huang</em></blockquote><p>When Huang said this, it wasn’t just an invitation to buy more GPUs. It was a call to action for engineers. As software engineers, we cannot rely on hardware alone to make AI faster — we optimize system performance that makes AI viable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ae4dc434182" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[學習筆記 | 面試會用到的 C++]]></title>
            <link>https://medium.com/@berlinnn3388/%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-%E9%9D%A2%E8%A9%A6%E6%9C%83%E7%94%A8%E5%88%B0%E7%9A%84-c-c-8770d03f551c?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/8770d03f551c</guid>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Sun, 21 Sep 2025 20:09:11 GMT</pubDate>
            <atom:updated>2026-05-13T10:38:02.686Z</atom:updated>
            <content:encoded><![CDATA[<h3>前言</h3><p>由於面試一家公司 C++ 滑鐵盧，決定整理一篇期望能覆蓋大多數會被問的 C++！希望可以幫助到大家。</p><h3>目錄</h3><ul><li><a href="#f9fd"><strong>OOP in C++</strong></a></li><li><a href="#23f3"><strong>Common Specifiers</strong></a></li><li><a href="#2268"><strong>Memory Allocation</strong></a></li><li><a href="#41f8"><strong>Advanced</strong></a></li><li><a href="#f6d8"><strong>Misc.</strong></a></li></ul><h3><strong>OOP in C++</strong></h3><h4>▌Class / Object / Struct / Union</h4><ul><li><strong>Class </strong>是一個 user-defined 的類別可以支援 OOP，包含 constructor、destructor、member variable、member function。</li><li><strong>Object 是由 Class 創建的實例</strong>，包含該 Class 定義的屬性和方法。</li><li><strong>Struct 跟 Class 幾乎一樣，但預設為 public</strong>，用來表示簡單的資料結構。</li><li><strong>Union</strong> 用來節省空間，一次只能存一個成員的值。</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqC3iXUAYPnGaaZlQZ0Sqg.png" /></figure><h4>▌OOP 特性</h4><ul><li><strong>Abstraction：</strong>隱藏實作細節，僅展示對外部使用者有意義的 interface，以簡化複雜系統。</li><li><strong>Encapsulation：</strong>將 data、functions 包在一個類別中，隱藏內部的 states並提供外部看得到的 interface，有助於控制外部的 access。</li><li><strong>Friend：</strong>突破 Encapsulation 的限制，被 class A 標記為 friend 的 class B或 function B 可以 access class A 的 private/protected member。</li><li><strong>Inheritance：</strong>使 class 可以從更 general 的 class 繼承部分屬性和方法。</li><li><strong>Polymorphism：</strong>不同的 class 能透過相同的接口，以實現不同方法的能力。<br><strong>- Compile-time Polym. (static binding</strong>, aka<strong> early binding)：</strong>編譯時就已經把函式定義和呼叫連結了，要實現這個可能要靠 <strong>overload</strong> function / operator (根據參數的型態決定調用哪個方法)。<br><strong>- Run-time Polym. (dynamic binding</strong>, aka<strong> late binding)：</strong>執行時才會連接方法，通常透過繼承 + virtual 來達成，也就是 derived class 的定義中要 <strong>override</strong> base class 的 virtual function。</li><li><strong>Access Specifier：</strong>包括 public、private、protected。</li></ul><h4>▌Virtual Function</h4><p>Virtual Function 是 C++ 支援執行期多型 (Run-time Polymorphism) 的主要機制，它是 C++ 獨有的特性。直觀來想 <strong>Virtual 可以連結到其延遲、不確定的特性</strong>，直到 run-time 才能透過內部機制確認要跑的程式碼。</p><h4><strong>使用方法</strong></h4><p>在 base class 用 virtual標記要做 virtual function 的函式，然後在 derived class 內用相同的名字 override (關鍵字 override可省略但加了好 debug)，請見下面的例子：</p><pre>class Car { <br>public: <br>   // 1. Non-virtual<br>   void startEngine() { cout &lt;&lt; &quot;Car: Starting a general combustion engine.\n&quot;; } <br>   <br>   // 2. Virtual<br>   virtual void accelerate() = 0; // pure vitual<br><br>   // 3. Virtual<br>   virtual void charge() { cout &lt;&lt; &quot;Car: Finding general fueling/charging station.\n&quot;; } <br>   <br>   // 4. Virtual<br>   virtual void selfDrive() { cout &lt;&lt; &quot;Car: Using basic self-driving assistance.\n&quot;; } <br>}; <br><br>class ModelY : public Car { <br>public: <br>   // 1. Non-virtual (name hiding)<br>   void startEngine() { cout &lt;&lt; &quot;ModelY: Starting electric drivetrain silently.\n&quot;; } <br>   <br>   // 2. Override<br>   void accelerate() override { cout &lt;&lt; &quot;ModelY: Instant electric torque acceleration.\n&quot;; } <br>   <br>   // 4. Overload<br>   void selfDrive(int level) { cout &lt;&lt; &quot;ModelY: Engaging Autopilot level &quot; &lt;&lt; level &lt;&lt; &quot;.\n&quot;; } <br>}; <br><br>int main() <br>{ <br>    ModelY* car = new ModelY();<br>      <br>    car-&gt;startEngine(); // startEngine() in ModelY<br>    car-&gt;accelerate(); // overriden accelerate() in ModelY<br>    car-&gt;charge(); // startEngine() in Car<br>    car-&gt;selfDrive(); // selfDrive() in Car<br>    car-&gt;selfDrive(2); // selfDrive() in ModelY<br>}</pre><h4>運作原理</h4><p>推薦這篇教學：<a href="https://medium.com/theskyisblue/c-%E4%B8%AD%E9%97%9C%E6%96%BC-virtual-%E7%9A%84%E5%85%A9%E4%B8%89%E4%BA%8B-1b4e2a2dc373">C++中關於 virtual 的兩三事</a>，歸納重點如下：</p><ul><li>編譯時：幫每個有 virtual 的類別建立一個 <strong>vTable (一個類別一個)。</strong></li><li>建構物件時：設定好 <strong>vptr</strong> <strong>(指向 vTable 的 pointer，一個物件一個)</strong>。</li><li>Run-time：會依據該物件的 vptr，找到該類別的 vTable，並找到正確的函式實作。這就是為什麼他叫做 <strong>Run-time Polymorphism (dynamic binding / late binding)。</strong></li></ul><h4>Virtual 的分類</h4><ul><li><strong>Pure Virtual：</strong>在 base class 裡面寫一個空的 pure virtual function 就是「<strong>強迫 derived class 必須實作這個函式，只繼承 interface」</strong>。當一個類別有 pure virtual 就代表實作不完整、不能獨立宣告物件，也就是抽象類別 (Abstract Class)。</li><li><strong>Simple/Regular Virtual：</strong>指除了 pure 的 virtual function，代表「<strong>derived class 可以實作這個函式也可以不要，繼承 interface 和 default implementation」</strong>，不 override 的話就用預設的基本版本。</li></ul><h3><strong>Common Specifiers</strong></h3><p>一些修飾變數/函式時的關鍵字，用來表示 scope、lifetime、usage 等特性的 Storage Class。</p><h4>▌static</h4><p>標註 static 的東西會從程式一開始執行就存在，<strong>不會因為離開 scope 就消失，會一直存在到程式結束。</strong>同樣的概念可能會用在以下情境：</p><ul><li><strong>local static variable：</strong>不會因為 function 結束而消失。</li></ul><pre>void f() {<br>    static int a = 0;<br>    a++;<br>    cout &lt;&lt; a;<br>}<br><br>int main() {<br>    f();  // 1<br>    f();  // 2<br>    f();  // 3<br>}</pre><ul><li><strong>global static variable：</strong>和一般的 global variable 不同的是，global variable 在 link 後可以在別的 file 透過 extern 關鍵字去讀取，加了 static 就不行！</li></ul><pre>// file1.cpp<br>int a = 5 // global<br>// static int a = 5; -&gt; global static<br><br>void f() {<br>    std::cout &lt;&lt; a;<br>}<br><br>int main() {<br>    f();  // 5<br>}</pre><pre>// file2.cpp<br>extern int x;<br><br>int main() {<br>    cout &lt;&lt; x;  // 10<br>}</pre><ul><li><strong>class 裡的 static member variable/function：</strong>所有以此 class 生成出來的 instance 都共用同一個 static variable/function</li></ul><pre>class A{<br>    static int val;<br>    static int get(){<br>       return val;<br>    }<br>}<br><br>int main() {<br>    int A::val = 0;<br>    cout &lt;&lt; A::val;<br>    cout &lt;&lt; A::get();<br>}</pre><blockquote><em>我們可以取用這個 variable/function 即使沒有 instance，因為此操作不會綁定某個物件 (不會訪問 </em><em>this 指針)。</em></blockquote><blockquote><em>cf. Singleton 設計模式：都是 share 同一組變數，但 Singleton 不能創第二個實例，但這裡的方法是可以創建多個實例只是 static 變數是一樣的。</em></blockquote><ul><li><strong>header file 裡的 global static：</strong>若多個 .cpp 會 include 同一個 .h 且調用同個變數/函式時，則在 link 多個 .o (編譯完的 .cpp) 就會出 “multiple definition” 問題！所以標註 static就可以使該變數/函式限定在 file 內。</li></ul><pre>// header.h<br>#ifndef HEADER_H<br>#define HEADER_H<br><br>static int x = 10;  // cf. int x = 10<br>static void printX() {<br>    std::cout &lt;&lt; &quot;value of x: &quot; &lt;&lt; x &lt;&lt; std::endl;<br>}<br><br>#endif  // HEADER_H</pre><h4>▌extern</h4><p>在 .h 中標註這個變數的存在，但是不是在此 .h 做宣告，而是在其他會include 此 .h 的 .cpp 檔案中宣告。</p><p><a href="https://medium.com/@alan81920/c-c-%E4%B8%AD%E7%9A%84-static-extern-%E7%9A%84%E8%AE%8A%E6%95%B8-9b42d000688f">這篇教學</a>有提供一個簡單實際的例子，講得很清楚可以去看！</p><h4>▌const</h4><p>可用來固定變數值 / pointer，也可以確保函式無法修改任何 class member variable。</p><pre>const int a = 5 // a is read-only<br><br>const int * a; // a pointer pointing at a const int variable<br>int const * a; // a pointer pointing at a const int variable<br>int * const a; // a const pointer pointing at an int variable<br>int const * const a; // a const pointer pointing at a const int variable<br><br>class A {<br>  public:<br>      A() {}<br>  <br>      int getCounter() const { // cannot revise counter<br>          //counter++; // compile error<br>          int number;<br>          number = 10; // can change local variable<br>          return counter;<br>      }<br>  <br>      void addCount() {<br>          counter++;<br>      }<br>  <br>  private:<br>      int counter = 0;<br>};</pre><h4>▌inline</h4><p>將修飾的函式設為 inline function，即像巨集 (macro) 一樣將該函式展開編譯，用來加速執行速度。</p><p>✔尤其對於小且常用的功能可以減少 function call overhead</p><p><strong>✗ </strong>產生很多 copies 導致 register 使用量增加；僅為給 compiler 的 hint，compiler 不見得會照做</p><pre>inline int square(int x) {<br>    return x * x;<br>}<br><br>int a = 5, b = 2;<br>std::cout &lt;&lt; &quot;Square of a + b: &quot; &lt;&lt; square(a + b) &lt;&lt; std::endl; // 49</pre><blockquote><strong><em>cf. 巨集 (macro)：</em></strong><em>巨集不會檢查/轉換參數型態，通常用於更簡單的函式</em></blockquote><pre>#define SQUARE(x) (x * x) // text substitution<br><br>std::cout &lt;&lt; &quot;Square of a + b: &quot; &lt;&lt; SQUARE(a + b);<br>// error: (a + b * a + b) -&gt; a + ab + b</pre><h4>▌volatile</h4><p>被修飾的變數表示<strong>可能會被不預期的更新，因此告知 compiler 不對它做最佳化。</strong>每次操作它的時候，都會讀取該變數實體位址上最新的值，compiler 也不會將其存在 register。</p><p>volatile 在嵌入式系統開發很重要，因為常涉及到硬體暫存器、I/O、中斷 (ISR, DSR) 的情境。也常被用來修飾 multithread 的共享變數，以確保值是最新的。</p><pre>volatile uint32_t *UART_STATUS = (volatile uint32_t *)0x4000C000; // from hardware register<br>volatile int interrupt_flag = 0; // ISR will revise this<br>volatile int shared_data = 0; // shared variable among threads</pre><h3>Memory Allocation</h3><h4>▌Static Memory Allocation / Stack</h4><p>存放在 <strong>stack </strong>(n-MB)，運作原理和 stack 一樣是 LIFO，當一個函式執行完畢，系統會自動管理空間，不需要擔心 memory leak，但如果超過會 stack overflow。</p><p>函式/class 裡的成員在 out of scope 時會被自動回收，除了被標註 static的成員會在整個程式結束時才會被回收。</p><h4>▌Dynamic Memory Allocation / Heap</h4><p>存放在 <strong>heap </strong>(n-GB)，一般創建的物件要手動刪除，否則可能導致 memory leak (除了 <strong>std::vector</strong> 會自動管理，非常好用)。</p><ul><li><strong>(C++ 用法) new — delete</strong></li></ul><pre>int* arr = new int[5];<br>...<br>delete[] arr; </pre><ul><li><strong>(C 用法) malloc — free：</strong>手動算記憶體大小、不會 call constructor、return void* 需要注意類型轉換…</li></ul><pre>int* arr = (int*)malloc(5 * sizeof(int));<br>...<br>free(arr);</pre><ul><li><strong>(C++ 用法) 使用 std::vector：</strong> 超方便的不用手動管理記憶體！</li></ul><pre>std::vector&lt;int&gt; vec(5);</pre><h3>Advanced</h3><h4>▌Design Pattern: Factory Method 工廠方法模式</h4><p>把物件的建立過程封裝起來，使得 client 不需要關心具體物件是如何建立的，只需透過指定具體工廠、使用共用的介面，就可以取得所需的產品。</p><p>實作上會需要定義多個 <strong>工廠</strong> (例如class Model3Factory : public CarFactory) 以支援不同的 <strong>產品 </strong>(例如class Model3 : public Car)，每個 factory method 對應一個具體的產品。</p><pre>CarFactory* factory = new Model3Factory();<br>Car* car = factory-&gt;createCar();<br>cout &lt;&lt; car-&gt;getModel();</pre><blockquote><strong><em>Simple Factory：</em></strong><em>簡化版本，只有一個工廠，根據參數決定要建立的產品，例如 </em><em>Car* car = CarFactory::createCar(“Model 3”)簡單但不易擴展。</em></blockquote><h4>▌Design Pattern: Abstract Factory 抽象工廠模式</h4><p>和前者不同的是，這裡的工廠創建一組確保產品相容的接口，<strong>返回一組 product family 而不是具體產品！</strong>這裡比較強調的是具體工廠中會實作<strong>組件之間的相容性</strong>，像是 Wheel、Interior 從同個工廠出來的就會相容，client 只要確保產品都是從同一個指定工廠出來的就沒問題了。</p><pre>CarFactory* factory = new Model3Factory();<br>Wheels* wheels = factory-&gt;createWheels();<br>Interior* interior = factory-&gt;createInterior();<br>cout &lt;&lt; wheels-&gt;getType();<br>cout &lt;&lt; interior-&gt;getMaterial();</pre><h4>▌Design Pattern: Singleton 單例模式</h4><p>用來保證這個類別只有一個 instance 存在，這樣在程式碼呼叫 getInstance() 都會得到一樣的東西。實作方式就是利用 static，eager 的方法就是放一個在全域變數，lazy 的方法就是呼叫才初始化實例。</p><p>Lazy singleton 不佔用進入 main() 前的時間 (尤其當初始化很耗時)，單純的想法是當 instance == nullptr 再初始化，但這樣不<strong> </strong>thread-safe 還得用 lock。<br>這是最簡單常見的 lazy singleton 實作方式：</p><pre>#include &lt;iostream&gt;<br>#include &lt;thread&gt;<br>using namespace std;<br><br>class Singleton {<br>public:<br>    static Singleton&amp; getInstance() {<br>        static Singleton sInstance; // initialized when first being called<br>        return sInstance;<br>    }<br><br>private:<br>    Singleton() {}<br>};<br><br>int main() {<br>    cout &lt;&lt; &quot;main&quot; &lt;&lt; endl;<br>    thread t1([]{<br>        cout &lt;&lt; &quot;singleton addr: &quot; &lt;&lt; &amp;Singleton::getInstance() &lt;&lt; endl;<br>    });<br>    cout &lt;&lt; &quot;singleton addr: &quot; &lt;&lt; &amp;Singleton::getInstance() &lt;&lt; endl;<br>    t1.join();<br>    return 0;<br>}</pre><h4>▌Design Pattern: More</h4><p>其他的設計模式可能就沒那麼重要，但是看過有個輪廓可能會對未來的 coding style 有幫助！</p><ul><li><strong>Observer Pattern 觀察者模式：</strong>常用於訂閱服務，當一個物件發生改變可以通知多個觀察者。</li><li><strong>Decorator Pattern 裝飾器模式：</strong>裝飾器藉著包裝物件來加入新行為與職責，展現開放/封閉原則的經典例子 (開放擴展、拒絕修改)。</li><li><strong>Strategy Pattern 策略模式：</strong>將一系列策略/演算法封裝起來，並在類別內實作正確的行為介面。</li><li><strong>Command Pattern 命令模式：</strong>將命令封裝起來，把請求發送者和接收者解耦，接收者會執行相應的動作。</li></ul><h4>▌Diamond Problem</h4><p>OOP 繼承可能會遇到的問題，假如我原有 base class Person，也有 derived class Teacher、Student。現在我又新增 class TeachingAssistant要繼承 Teacher、Student，這樣資料、實作方法都會有問題。</p><p>解決方法可以是 virtual inheritance (解決重複資料副本的問題) + virtual function (解決不知道用哪個實作的問題)。請參考以下：</p><pre>class Person {<br>public:<br>    int id;<br>    Person(int i) : id(i) {}<br>    virtual void getRole() = 0;<br>};<br><br>// virtual inheritance<br>class Teacher : public virtual Person {<br>public:<br>    Teacher(int i) : Person(i) {}<br>    void getRole() override {<br>        std::cout &lt;&lt; &quot;Role: Teacher\n&quot;;<br>    }<br>};<br><br>// virtual inheritance<br>class Student : public virtual Person {<br>public:<br>    Student(int i) : Person(i) {}<br>    void getRole() override {<br>        std::cout &lt;&lt; &quot;Role: Student\n&quot;;<br>    }<br>};<br><br>class TeachingAssistant : public Teacher, public Student {<br>public:<br>    TeachingAssistant(int i) : Person(i), Teacher(i), Student(i) {}<br><br>    // must override to prevent conflict<br>    void getRole() override {<br>        std::cout &lt;&lt; &quot;Role: Teaching Assistant (ID: &quot; &lt;&lt; id &lt;&lt; &quot;)\n&quot;;<br>    }<br>};</pre><h3>Misc.</h3><h4>▌C vs. C++</h4><p>C 是一個 <strong>procedural programming language (</strong>a sequence of statements or functions)。</p><p>C++ 是 <strong>procedural programming + object-oriented programming (OOP)</strong>，可以用 class 來封裝資料和方法，還多了很多進階的功能 (I/O、error handling、pass by reference without pointers)。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QcN4nYxpIF1zh9GjBivsyA.png" /></figure><h4>▌前置處理器</h4><p>編譯之前處理 # 開頭的就是前置處理器！</p><pre>// Tracking.h<br>#ifndef TRACKING_H // include guard<br>#define TRACKING_H<br><br>#include &lt;opencv2/opencv.hpp&gt; // include library<br>#include &quot;Viewer.h&quot;<br>#define PI 3.1415926 // define constant<br>#define SQUARE(x) ((x) * (x)) // define function<br><br>...<br>...<br><br>#endif</pre><p>Include guard 常被用於防範被重複 include 的問題：這裡第一次 include 時會定義 TRACKING_H 巨集，被再次 include 時就直接跳到 #endif；也有人是習慣用 #pragma once達到一樣的效果。</p><h4>▌namespace</h4><p>用 namespace A { ... }、namespace B { ... } 括住不同區塊可以防止 identifier name conflict，使用時要指定是在哪個 namespace 下定義的功能。</p><pre>#include &lt;iostream&gt;<br>using namespace std; // bring all std&#39;s names into the current scope<br><br>namespace A {<br>    void display() {<br>        cout &lt;&lt; &quot;A display function&quot; &lt;&lt; endl;<br>    }<br>}<br><br>int main() {<br>    A::display(); // (1) use qualifier ::<br>   <br>    using namespace A; // (2) bring all std&#39;s names into the current scope<br>    display();<br>}</pre><h4>▌lambda expression</h4><p>一種提高可讀性的函式表達方法，直接抓取外部變數而不用顯示表達。</p><pre>auto comp = [](vector&lt;int&gt; a, vector&lt;int&gt; b) -&gt; bool {<br>                return a[0] &lt; b[0];<br>            };<br><br>// [ ] no externel variable<br>// [=] all by value<br>// [&amp;] all by reference<br>// [x, &amp;y]<br><br>priority_queue&lt;vector&lt;int&gt;, vector&lt;vector&lt;int&gt;&gt;, decltype(comp)&gt; pq(comp); // a max heap</pre><h3>Reference</h3><ul><li><a href="https://www.mropengate.com/2017/08/cc-c.html">C/C++ — 常見 C 語言觀念題目總整理（適合考試和面試）</a></li><li><a href="https://hackr.io/blog/cpp-interview-questions?fbclid=IwAR0GluAmoeBIvnMmqhxBMvb0bElUBSa63eTsy5dwd9ret2_ejgvbhnNBfnQ">Top 40 C++ Interview Questions and Answers in 2025</a></li><li><a href="https://hackmd.io/@tdHunoNrTn-bGXOx_ctBNA/HyyWVsDM3#1-%E7%B9%BC%E6%89%BF">CPP 面試筆記</a></li><li><a href="https://medium.com/@alan81920/c-c-%E4%B8%AD%E7%9A%84-static-extern-%E7%9A%84%E8%AE%8A%E6%95%B8-9b42d000688f">C/C++ 中的 static, extern 的變數</a></li><li><a href="https://alrightchiu.github.io/SecondRound/mu-lu-yan-suan-fa-yu-zi-liao-jie-gou.html">演算法與資料結構大全</a></li><li><a href="https://www.youtube.com/watch?v=SfGuIVzE_Os&amp;list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb&amp;index=5">The Cherno C++ Playlist</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8770d03f551c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[美國留學 | 2025 Fall | CMU MSCV 1st Semester]]></title>
            <link>https://medium.com/@berlinnn3388/%E7%BE%8E%E5%9C%8B%E7%95%99%E5%AD%B8-2025-fall-cmu-mscv-%E5%B0%B1%E8%AE%80%E9%AB%94%E9%A9%97-b75d01d5e7fe?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/b75d01d5e7fe</guid>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 02:53:33 GMT</pubDate>
            <atom:updated>2026-04-14T02:24:07.871Z</atom:updated>
            <content:encoded><![CDATA[<h3>前言</h3><p>這週總算完成了 Final Project Presentation，只剩書面報告，趁著難得有空心情也不錯來記錄一下留學生活。心情好是因為寫這句話的我正在機場等飛機回家哈哈哈，而且還在回來前看到雪了！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2EPyVYQGarWgdfLnMrzuA.png" /><figcaption>登出 2025 FALL!!!</figcaption></figure><h3>課業</h3><p><strong>先聲明我絕對不是傳統意義上的好學生哈哈哈</strong>，這學期因為準備找工比較花時間，策略是少去實體課、看課程錄影補課、期末專題認真做！<strong>個人認為專題實作經驗幫助我很多</strong>，任何領域都要認真做一遍才知道有興趣，而且做得好還可以放在履歷上！</p><h4>16820: Advanced Computer Vision</h4><p><a href="https://sites.google.com/andrew.cmu.edu/16-820-spring-2025/home">Course Website</a><br>Rate: ★★★ / Workload: 29 h (hw) (超涼)</p><p>MSCV 必修課，發現課程多半還是影像處理和 Geometry 後，驚覺我對 CV 的視野還是受限了 (修了台大 DLCV 以為有用的都是 DL，但發現傳統算法還是挺有用的，尤其在 3D Vision)。雖然我都沒去上課，但為了寫作業還是稍微熟悉了相關理論。個人覺得作業設計得還不錯，實作不會太難但很多寫報告的地方，對 CV 有興趣可以修 (或是外系多修的<strong> </strong><a href="http://16385.courses.cs.cmu.edu/"><strong>16385: Computer Vision</strong></a>)。</p><p>因為只要寫作業、沒考試、沒期末專題，所以挺輕鬆的！</p><p>- HW1：Histograms of Oriented Gradient<br>- HW2：Lucas-Kanade 演算法 (<a href="https://www.ri.cmu.edu/pub_files/pub3/lucas_bruce_d_1981_1/lucas_bruce_d_1981_1.pdf">CMU 經典論文</a>)<br>- HW3：Homography<br>- HW4：Camera Motion (從對應點推相機移動) + SFM (重建 3D 場景)<br>- HW5：Neural Networks<br>- HW6：Photometric Stereo (已知或未知光照下推導物體形狀)</p><h4>16831: Introduction to Robot Learning</h4><p><a href="https://16-831.github.io/fall25/lectures/">Course Website</a> / <a href="https://scs.hosted.panopto.com/Panopto/Pages/Sessions/List.aspx#folderID=%225be851b0-e674-48c5-996c-b344011151c5%22%E3%80%81">Recordings</a><br>Rate: ★★★.5 / Workload: 90 h = 35 (lecture + hw) + 55 (fp)</p><p>RI 開的必修課 (和 Intro to ML 二選一)，終於正式學了 Robot Learning 也就是「<strong>Learning</strong> to make <strong>sequential</strong> decisions in the <strong>physical world」</strong> (三者缺一就只能分別算是 Classic Control、Supervised Learning、RL/LLM)。</p><p>老師 <a href="https://www.ri.cmu.edu/ri-faculty/guanya-shi/">Guanya Shi</a> 是非常聰明的學者，講解概念非常清楚，不過講到比較數學的地方我真的是跟不上… 尤其是 Model-Free RL 後半段看影片重播、想很久還是放推… 但至少透過這堂課熟悉一些概念也挺好的，包括 model-free /model-based RL、on/off-policy、online/offline，學完可以跟得上最新的機器人研究！</p><p>個人認為出得挺有心的而且順便玩一下模擬環境 (作業用 OpenAI Gym)，不過有的作業 Train 不起來又找不到錯誤就會變時間黑洞…</p><p>- HW1：Imitation Learning<br>- HW2：Policy Gradient<br>- HW3：Q-learning + Actor-Critic<br>- HW4：Model-Based RL<br>- Final Project：5-min Oral Presentation + Report</p><h4>Final Project</h4><p><strong>HydroSelf: Undulatory Swimming through Resilient Self-Organization<br></strong><a href="https://docs.google.com/presentation/d/1Vud8cceVkI4Xqtnn5zXhVna2Ju6DfnQXgmQNLcgvPE8/edit?usp=drive_link">Presentation</a> / <a href="https://drive.google.com/file/d/1-rkVcRfrzAJNvsdxhwD7sjyyPeUdQj_k/view?usp=sharing">Report</a> / <a href="https://github.com/berlin0308/Undulatory-Swimming-CPG-RL">Code</a></p><p>我們做的是機器人電鰻的游泳，想了一些方法把經典的控制方法 CPG 整合 RL，算是第一次自己建模擬環境 (Genesis) 和設計 Reward Function (forward speed、energy、smoothness…)，最後甚至做到 Sim2Real，最後報告的回饋很好！雖然最後兩週爆肝了但還是很不錯的經驗，特別感謝厲害的隊長跟我天天雙排。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ITJhGmnrmnt9PuYCd7bkIw.png" /></figure><h4>10714: Deep Learning Systems</h4><p><a href="https://dlsyscourse.org/">Course Website</a> / <a href="https://dlsyscourse.org/lectures/">Recordings</a><br>Rate: ★★★★.5 / Workload: 138 = 62 (lecture + hw) + 75 (fp)</p><p>選修選到好課！這堂課是 ML Department 開的，其中一位教授是大名鼎鼎的 <a href="https://scholar.google.com/citations?user=7nlvOMQAAAAJ&amp;hl=en">TQ Chen</a> (甚至 Career Fair 被招募官問有沒有上過他的課…)。</p><p>這堂課著重於<strong>「如何設計可支持各種模型/優化的系統」</strong>，上完這堂課會知道 Torch 這樣的框架實際上是怎麼設計和實作的 (例如硬體後端支援、CNN im2col、Attention 實作細節)，算是解開了我長期的疑問，而且都會在作業中實作到，所以個人認為非常有收穫。</p><blockquote><em>相似的課程包括 TQ Chen 開的另一門 </em><a href="https://csd.cmu.edu/course/15642/s24"><em>15642: ML Systems</em></a><em>，比較像</em><strong><em>「系統層面的優化」</em></strong><em>(後來我決定 2026 Spring 修)；另一堂自學的 </em><a href="https://hanlab.mit.edu/courses/2024-fall-65940"><em>MIT 6.5940: TinyML and Efficient DL Computing</em></a><em> 比較像是</em><strong><em>「演算法層面的優化」</em></strong><em>(例如 Sparsity、Quantization、NAS)。</em></blockquote><p>學期初從 ML 基礎開始，先講到 Automatic Differentiation (計算梯度時就知道 DSA 的 Topological Sort 真的會用到！)，然後帶到深度學習框架是如何設計的。到這裡的作業都是用 Numpy 完成各式各樣的運算和梯度推導，但之後隨著我最喜歡的 Hardware Acceleration 主題到來，會學習到這些運算如何在 CPU 和 GPU 上加速，也會實作自己的 C/C++ 後端。</p><p>課程的後半段主要是講深度學習模型的演算法和實作，包括 CNN、RNN/LSTM、Transformer、Generative Models。演算法就當作複習，但實作就有趣了，雖然還是被各種多維陣列搞得頭昏眼花，但還是會讚嘆我一個平凡學生居然可以刻出一個陽春的 PyTorch！課程的最後是 ML Compilation &amp; Deployment，只能說老師不愧是 OctoAI、TVM、MLC 等該領域神級專案的創辦者，也啟發了我在期末專題用 TVM 作為我的 ML Compiler。</p><p>- HW1：Basic Operators (forward + backward)<br>- HW2：NN Layers (init + norm + training)<br>- HW3：NDArray Backends (CPU + CUDA)<br>- HW4：CNN + LSTM<br>- HW4 Extra：Transformer<br>- Final Project：90-sec Video + Report + Code</p><h4>Final Project</h4><p><strong>NeedleGX: Needle-based Graph Inference Acceleration Extension<br></strong><a href="https://www.youtube.com/watch?v=_pV5XCpGG5g">Video</a> / <a href="https://drive.google.com/drive/u/2/folders/1D4cSA7cayTSlZbrRJz6S8cdlWR9Q2HD0">Code</a> / <a href="https://colab.research.google.com/drive/1oVqgtbpL4EHAwcyOmWvNH6_B2WKYJD1p">Colab</a></p><p>因為對硬體加速有興趣、想玩玩看 TVM，加上組員對 Sparse 有興趣，所以結合起來就是 GNN Inference Optimization。這堂課的要求是在既有 Needle (我們作業刻出來的 DL 框架) 上擴展，我們的設計是有 TVM、Needle Native Backend 可以切換。以結果來說 TVM 在 GCN Inference 比自家的實現快了 12X，單就 SpMM 也比 NVIDIA cuSPARSE 好不止一些。</p><p>我做的 TVM Backend 實作了 GNN 需要的 SpMM、GEMM、ReLU 運算子，硬體方面支援 CPU 的 LLVM、LLVM + AVX-2/AVX-512，還有 GPU 的 CUDA Core、Tensor Core。此外我也有做到 <a href="https://tvm.apache.org/2021/03/03/intro-auto-scheduler">Auto-Scheduling</a> (最佳化各種 tiling / unrolling 等等的底層參數)，我認為很有趣，有興趣的讀者歡迎找我討論！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HVn8PKAauhYYKloSL1ZAtA.png" /></figure><p>做下來小小的心得是 ML Compiler 水很深，尤其像是 Tensor Core + Sparse 資料很少，刻論文方法時常遇到 TVM 支援不足、需要找各種 Workaround，感嘆 CS 基礎不強導致非常吃力。</p><h3>找工</h3><p>沒找到⋯下學期繼續努力了。還沒落地美國時只知道刷題和複習 ML，但八月來了之後發現 ML 職缺沒 PhD 沒研究根本不可能，但說到 SWE 我 Coding 能力不好又討厭刷題，實在是很尷尬，而且就算進到面試也沒能力答得很好。其實周遭人應該投得更多，但一些職缺我怎麼想也不可能進面試，就乾脆不投了。</p><p>十月之後直接放推哈哈哈。想說前幾個月心態有點崩，不如實實在在地做期末專題、深化 Domain Knowledge、搞清楚職涯目標比較實際！而且學到東西至少會有成就感！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*S66wLidBY9AMoM3DSjWl5A.png" /><figcaption>2025 Fall 找實習總結</figcaption></figure><blockquote><em>後記：不過寒假和春招倒是收到不少面試機會！許多自駕車/機器人企業都是春季才招實習生。</em></blockquote><h3>生活</h3><p>相較於擁擠悶熱的台北，美國天氣舒服很多：夏天空氣很乾、即使大太陽也涼涼的；冬天下雪景色很讚，不過偶爾天暗會讓心情有點陰鬱。</p><p>因為校園不在匹茲堡市區，我覺得挺純樸挺好的，也很好融入！有人會說無聊，但對一個忙得天昏地暗的我來說，平時去個咖啡店、跟同學聚個餐也就差不多了。這學期也有體驗到打高爾夫、划船、攀岩等等。</p><p>用英語社交是我比較難突破的點，我連在台灣都不太敢跟店員講話了，到這裡更難了，到後來因此不想吃外食⋯倒是 Career Fair 讓我在職場英語和社交很有進步還不錯！</p><p>出國之後多了很多獨處的時間，某種程度上因此更有效率、更自由也更成熟了，美國果然是 INTJ 如我特別適合的地方！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZsQrumwV-iF8ZnLszwjzdg.png" /><figcaption>學校後面的高爾夫球場 (只打過一次)</figcaption></figure><h4>A Realistic Day in My Life</h4><p>12:00 起床 (早起的話去健身房)<br>13:00 吃午餐暖個機<br>14:00 開工！確認信箱收 Unfortunatelies、職缺刷一刷、履歷丟一丟<br>15:00 要動腦的工作 (e.g. 上課、做作業、準備面試) (進度還可以的話，獎勵自己去逛個超市)<br>18:00 回家煮晚餐順便休息一會<br>20:00 不太動腦的雜事 (e.g. 規劃行程、寫文章)<br>24:00 準備睡覺</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbNkz5cdwoUzIa9RUFFxOA.png" /><figcaption>讀書區景色</figcaption></figure><h3><strong>Passion Projects</strong></h3><h4>Berlin’s Mentorship Program (BMP)</h4><p>年底是申請美國研究所的季節，這學期的 BMP 總共幫了 20 個左右學弟妹，有的是 <a href="https://www.projecttyra.org/">Project TYRA</a>、有的是看到<a href="https://medium.com/@berlinnn3388/2024-fall-%E8%B7%A8%E9%A0%98%E5%9F%9F%E7%94%B3%E8%AB%8B%E7%BE%8E%E5%9C%8Bcs-ece%E7%A0%94%E7%A9%B6%E6%89%80%E5%BF%83%E5%BE%97-f85e543f40a3">我的申請經驗分享</a>來問問題的、更多的是脆友。</p><p>很多同學問我為啥要無償幫忙？其實我也不知道。但總之這次的經驗讓我有很多收穫，身歷其境每個人的成長經歷有拓展我的視野，而且根據 Mentor 專精的子領域可以順便請教問題。我會推薦已經錄取的大家也來當當看留學顧問，會是一個特別的體驗！</p><h4>寫 Blog</h4><p>其實寫 Medium 大多是作為幫助自己計劃的用途，像是<strong>美國找實習</strong> (2025/2- 還沒找到不敢放)<strong> </strong>就是長期編輯，想說只記在自己的 Notion 太小氣了！</p><p>還有一類是找工路上督促自己的學習筆記，例如：<a href="https://medium.com/@berlinnn3388/%E6%BC%94%E7%AE%97%E6%B3%95%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-graph-b2ef856f28e0"><strong>學習筆記 | Graph</strong></a><strong>、</strong><a href="https://medium.com/@berlinnn3388/%E6%BC%94%E7%AE%97%E6%B3%95%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-binary-search-df741059c592"><strong>學習筆記 | Binary Search</strong></a><strong>、</strong><a href="https://medium.com/@berlinnn3388/orb-slam-%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-4d23d4979e77"><strong>學習筆記 | CUDA 實作 ORB-SLAM3</strong></a><strong>、</strong><a href="https://medium.com/@berlinnn3388/%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-%E9%9D%A2%E8%A9%A6%E6%9C%83%E7%94%A8%E5%88%B0%E7%9A%84-c-c-8770d03f551c"><strong>學習筆記 | 面試會用到的 C/C++</strong></a>，這些寫完也方便我快速 Pick up。</p><p>有時也會後悔花太多時間在寫哈哈哈，算起來這學期總共花了 33 h，塗塗改改耗了很多時間。</p><h3>Appendix: CMU MS Program Review</h3><h4>招牌：CMU SCS (School of Computer Science)</h4><blockquote><em>客觀的資訊網路上都找得到！這裡我就主觀評論 SCS 底下台灣人常去的 Institutes 和帶過下面的 MS Programs (這裡寫縮寫)：</em></blockquote><blockquote><em>Language Technologies Institute (LTI)：</em><strong><em>就業之神 MCDS</em></strong><em>、</em><strong><em>找工創業都可發展的 MSAII、LLM 找工路線 MIIS、縕儂的 MLT</em></strong></blockquote><blockquote><em>Robotics Institute (RI)：</em><strong><em>機器人科研天花板 MSR、我讀的 MSCV</em></strong><em>、</em><strong><em>去機器人公司的 MRSD</em></strong></blockquote><blockquote><em>其他的包括 </em><strong><em>神話一般的 MSCS</em></strong><em>、</em><strong><em>神秘的 MSML</em></strong><em>、</em><strong><em>目標軟工的 MSE</em></strong><em> (和矽谷校區 MSSE-SV 不一樣！)、</em><strong><em>生醫轉碼 MSCB</em></strong><em>、</em><strong><em>HCI 天花板 MHCI</em></strong><em>…</em></blockquote><h4>工程學院：CMU ECE &amp; INI</h4><blockquote><em>我想特別提到工程學院</em><strong><em>最多台灣人的大系 ECE</em></strong><em>，他們選課很自由，CS 神課 (e.g. Intro to Computer Systems、Cloud Computing) 上得比我還多，對軟體找工極有幫助！尤其對於本科 EE 要轉 CS 應該都挺友善的。</em></blockquote><blockquote><em>順帶提到 Information Networking Institute (INI) 也有幾個不錯的 MS Program 可以參考，對軟體找工很有幫助。</em></blockquote><h4>機器人學院：CMU RI</h4><blockquote><em>在 CMU 機器人領域是在 CS 學院底下，跟其他歸類在 ME / ECE 底下的 Robotics 不太一樣。CMU RI 比較像是設計機器人的大腦，很難不和 AI 綁在一起 (CV、Robot Learning)，後者更像把整個機器人做出來 (傳統機械、機電、控制系統)。我大學讀的比較是後者，來了覺得舒服很多，再也不用弄得手髒髒的。</em></blockquote><blockquote><em>提供 2025 Fall 錄取情報給學弟妹參考：</em><strong><em>MSCV (47/7/4)、MRSD (47/7/5)、MSR (80/4/?) </em></strong><em>(總人數/台灣學生/台大)。MSCV 錄取者大多有發論文的 CV 經驗，沒有的也有 CV 工作經驗；MRSD 很多機械背景的，來之前應該都累積很多機器人經驗，有讀完一碩的也有工作經驗的；MSR 是研究導向，似乎是由於學術預算被砍，Robotics PhD 申請不到就來了。</em></blockquote><blockquote><em>MSCV 雖然是就業導向 Program，但其實 CV 領域有一半是想做研究的，要讀博也行得通！不過因為 </em><strong><em>RI 的實驗室都是做 Robotics</em></strong><em> (廢話)，要做 CV 研究多半也是機器人的 3D Vision，要來提前部署 Physical AI 也是可行的。也可以和我一樣不進實驗室，等第二、三學期的 Capstone Project 再做。Capstone 有分企業贊助 (CV 相關機器人企業，較工程導向) 和學校的 (較研究導向，有機會發論文)，題目是贊助方定好再依學生興趣分配。</em></blockquote><blockquote><em>課程的話每學期三門課，個人認為上課內容和作業難，但和隔壁 MRSD 或其他 CS 科系相比課業不會很重！而且還沒有考試、不用出席、遠端友好、有 Final Project 可以做，有對到我覺得理想的學習模式。還有暑期實習，找實習就是自已的事情，然後由於 CPT 的規定是工作要和科系相關，所以做機器人、ML、CV 相關的就算可以，去金融業做 SDE 就說不太過去。</em></blockquote><h3>總結</h3><p>來美國的第一個學期很多時候是連滾帶爬，準備找工的過程挺焦慮的，好在作業沒有想像中的花時間。最後悔的是應該嘗試多一點休息，當時在風暴中根本沒心情規劃旅行 (只好寒假和下學期盡力玩回來)。至少生活上也體驗到很多新鮮事還不錯！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9uzy74Q_4zcnGFnYWQvH8A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b75d01d5e7fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[學習筆記 | Graph]]></title>
            <link>https://medium.com/@berlinnn3388/%E6%BC%94%E7%AE%97%E6%B3%95%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-graph-b2ef856f28e0?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2ef856f28e0</guid>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Thu, 19 Jun 2025 10:15:16 GMT</pubDate>
            <atom:updated>2025-07-27T18:13:13.080Z</atom:updated>
            <content:encoded><![CDATA[<h3>前言</h3><p>這篇會介紹 3 種特殊的 Graph 演算法 (Union-Find、Topological Sort、Dijkstra Algorithm) 以及其他一般的 Graph 題目。提供易讀的 C++ 模板和精選常見題目。</p><p>筆者的解題思路：先想直覺寫法 (DFS/BFS) → 想特殊解法是否可以派上用場 → 評估這幾種方法好不好寫 → 選最好寫的。因為 Graph 問題相對複雜，所以通常特殊解法若抄熟模板會比較少 bug，也會比較有把握。</p><h3>目錄</h3><ul><li><a href="#7b51"><strong>#1 Union-Find</strong></a><strong><br>- 模板</strong><br>- <a href="https://leetcode.com/problems/redundant-connection/description/">684. Redundant Connection</a><br>- <a href="https://leetcode.com/problems/number-of-islands/">200. Number of Islands</a></li><li><a href="#1644"><strong>#2 Topological Sort</strong></a><strong><br>- 模板<br>- </strong><a href="https://leetcode.com/problems/course-schedule-ii/">210. Course Schedule II</a><br>- <a href="https://leetcode.com/problems/longest-cycle-in-a-graph/description/">2360. Longest Cycle in a Graph</a><br>- <a href="https://leetcode.com/problems/longest-increasing-path-in-a-matrix/description/">329. Longest Increasing Path in a Matrix</a></li><li><a href="#169f"><strong>#3 Dijkstra Algorithm</strong></a><strong><br>- 模板<br>- </strong><a href="https://leetcode.com/problems/network-delay-time/">743. Network Delay Time</a></li><li><a href="#9fac"><strong>其他一般的 Graph 題目</strong></a><strong><br></strong>- <a href="https://leetcode.com/problems/course-schedule/">207. Course Schedule</a><br>- <a href="https://leetcode.com/problems/clone-graph/">133. Clone Graph</a></li></ul><h3>#1 Union-Find</h3><blockquote>用來處理 Connectivity 問題，又稱為 Disjoint Set</blockquote><p>Union-Find 可以用單純的 array 就做到 <strong>(1) 處理合併 union (Union)</strong>、<strong>(2) 判斷兩個 node 是否屬於同一個 union (利用 Find)</strong>。可以參考<a href="https://leetcode.com/explore/learn/card/graph/618/disjoint-set/">此介紹</a>。</p><p>實作上需要先把每個 node 的 parent 都初始化成自己，之後做出 <strong>find(int i)</strong> (找到 i 的 root) 以及 <strong>union_sets(int a, int b)</strong> (找到 a 和 b 的 root 並把他們連在一起)。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FO5caz0wUl_NiwWcomLqpA.png" /><figcaption>root of 3 is 9, root of 5 is 6 → 3 and 5 are not connected</figcaption></figure><p>此外，有兩個優化的方式，分別是<strong> (1) Weighting (2) Path Compression</strong>。前者「小樹接大樹」可以使樹更 balanced，也降低 find() 時間複雜度 (O(n) → O(log n) )；後者「跨接 grandparent」可以省略下次 find() 計算 (O(log n) → O( alpha(n)) ~ O(1) )。最終每次 find() 是 constant time！</p><h4>Union-Find 模板 (w/ weighting &amp; path compression)</h4><pre>vector&lt;int&gt; parent(n);<br>vector&lt;int&gt; sz(n, 1);<br>for(int i = 0; i &lt; n + 1; i++) parent[i] = i;<br><br>auto find = [&amp;](int i){<br>    while(parent[i] != i){<br>        parent[i] = parent[parent[i]]; // path compression<br>        i = parent[i];<br>    }<br>    return i;<br>};<br><br>auto un = [&amp;](int i, int j) {<br>    int root_i = find(i);<br>    int root_j = find(j);<br>    if(root_i == root_j) return;<br><br>    // weighting<br>    if(sz[root_i] &lt; sz[root_j]){<br>        parent[root_i] = root_j;<br>        sz[root_j] += sz[root_i];<br>    }else{<br>        parent[root_j] = root_i;<br>        sz[root_i] += sz[root_j];<br>    }<br>};</pre><h4><a href="https://leetcode.com/problems/redundant-connection/description/">684. Redundant Connection</a></h4><p>題目給定一個有 n nodes 和 n edges 組成的 undirected graph，這個有 cycle 的 graph 只要去除一個 edge 就可以變成沒 cycle 的。我們要找到那個要去除的 edge，若有多組解則回傳最後出現的 edge。</p><pre>Input: [[1,2],[1,3],[2,3]]<br>Output: [2,3]</pre><p>這題用 Union-Find 的原因是可以迭代處理 input、合併 union (i.e. connect components)，一旦發現新的 edge 兩端都在同一個 union 就可以直接回傳，而且「回傳最後出現的 edge」的邏輯也符合。</p><p>抄完 Union-Find 模板直接用：</p><pre>for(auto&amp; edge : edges){<br>    int a = edge[0];<br>    int b = edge[1];<br>    if(find(a) == find(b)) return edge;<br>    un(a, b);<br>}</pre><h4><a href="https://leetcode.com/problems/number-of-islands/">200. Number of Islands</a></h4><p>題目給一個 matrix，算出裡面有幾個 island？</p><pre>Input: <br>[ [&quot;1&quot;,&quot;1&quot;,&quot;0&quot;,&quot;0&quot;,&quot;0&quot;],<br>  [&quot;1&quot;,&quot;1&quot;,&quot;0&quot;,&quot;0&quot;,&quot;0&quot;],<br>  [&quot;0&quot;,&quot;0&quot;,&quot;1&quot;,&quot;0&quot;,&quot;0&quot;],<br>  [&quot;0&quot;,&quot;0&quot;,&quot;0&quot;,&quot;1&quot;,&quot;1&quot;] ]<br><br>Output: 3</pre><p>其實也可以用 BFS/DFS 去解啦，若要用 Union-Find 的話，抄完模板直接用就可以了。最終答案還要再 iterate 一遍看 root 有幾種。</p><pre>vector&lt;vector&lt;int&gt;&gt; dirs = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};<br>for(int r = 0; r &lt; m; r++){<br>    for(int c = 0; c &lt; n; c++){<br>        if(grid[r][c] == &#39;0&#39;) continue;<br><br>        for(auto&amp; dir : dirs){<br>            int new_r = r + dir[0];<br>            int new_c = c + dir[1];<br>            if(new_r &lt; 0 || new_r &gt;= m || new_c &lt; 0 || new_c &gt;= n <br>               || grid[new_r][new_c] == &#39;0&#39;) continue;<br>            un(r * n + c, new_r * n + new_c);<br>        }<br>    }<br>}<br><br>int res = 0;<br>unordered_set&lt;int&gt; s;<br>for(int i = 0; i &lt; m * n; i++){<br>    if(grid[i / n][i % n] == &#39;0&#39; || s.count(find(i))) continue;<br>    s.insert(find(i));<br>    res++;<br>}<br>return res;</pre><h3>#2 Topological Sort</h3><blockquote>針對 Directed Acyclic Graph (DAG) 的排序法。</blockquote><p>最簡單的做法就是 Kahn’s Algorithm：<strong>從 source (indegree = 0) 開始 BFS</strong>，過程中逐漸刪除 node 並更新 indegree。可以參考<a href="https://hackmd.io/OeOB6NHGSvGkkhJIZd5Jog">此教學</a>。</p><p>而要找到 source 以及照順序，就要先統計每個 node 的 indegree。</p><h4>Cyclic?</h4><p>有 cycle 的 graph 則某些 node 不會跑到，所以藉由<strong>比較「總共的 node 數量」和「實際走過的 node 數量」</strong>就可以知道是否有 cycle！</p><h4>Topological Sort 模板</h4><pre>queue&lt;int&gt; q;<br>unordered_map&lt;int, vector&lt;int&gt;&gt; m; // next nodes<br>vector&lt;int&gt; indegree;<br><br>/* <br>record indegree &amp; m<br>put source nodes in q<br>*/<br><br>vector&lt;int&gt; res; // sorted result<br>while(!q.empty()){<br>    int sz = q.size();<br>    for(int i = 0; i &lt; sz; i++){<br>        int p = q.front();<br>        q.pop();<br>        res.push_back(p);<br><br>        // update indegrees<br>        for(int next : m[p]){<br>            indegree[next]--;<br>            if(indegree[next] == 0) q.push(next);<br>        }<br>    }<br>}</pre><h4><a href="https://leetcode.com/problems/course-schedule-ii/">210. Course Schedule II</a></h4><p>根據 prerequisites 排出一個合理的課表，很明顯就是 topological sort。</p><p>題目說若無法完成所有課 (也就是存在 cycle) 則回傳空陣列，因此 return 那行變成：</p><pre>return res.size() == numCourses ? res : vector&lt;int&gt;();</pre><h4><a href="https://leetcode.com/problems/longest-cycle-in-a-graph/description/">2360. Longest Cycle in a Graph</a></h4><p>這題是要找 longest cycle，由於題目規定每個 node 都只會指向零個或一個 node，可以想像這個 graph 可能會有多個 cycle 但都是獨立的。</p><p>這題用 topological sort 可以用來<strong>「把不重要的非 cycle 成員剝掉」</strong>，剩下的就好辦了。也許是因為這題牽涉兩個步驟，歸類為 hard。</p><pre>int longestCycle(vector&lt;int&gt;&amp; edges) {<br>    int n = edges.size();<br>    vector&lt;int&gt; indegree(n, 0);<br>    for(int i = 0; i &lt; n; i++) <br>        if(edges[i] != -1) indegree[edges[i]]++;<br><br>    // topological sort<br>    queue&lt;int&gt; q;<br>    for(int i = 0; i &lt; n; i++)<br>        if(indegree[i] == 0) q.push(i); // sources<br><br>    while(!q.empty()){<br>        int sz = q.size();<br>        for(int i = 0; i &lt; sz; i++){<br>            int p = q.front();<br>            q.pop();<br><br>            if(edges[p] != -1){<br>                indegree[edges[p]]--;<br>                if(indegree[edges[p]] == 0) q.push(edges[p]);<br>            }<br>        }<br>    }<br><br>    // calculate cycle length<br>    unordered_set&lt;int&gt; s;<br>    int res = 0;<br>    for(int i = 0; i &lt; n; i++){<br>        if(indegree[i] &gt; 0){<br>            int cur = i;<br>            int len = 0;<br>            while(s.count(cur) == 0){<br>                s.insert(cur);<br>                cur = edges[cur];<br>                indegree[i]--;<br>                len++;<br>            }<br>            res = max(res, len);<br>        }<br>    }<br>    return res &gt; 0 ? res : -1;<br>}</pre><h4><a href="https://leetcode.com/problems/longest-increasing-path-in-a-matrix/description/">329. Longest Increasing Path in a Matrix</a></h4><p>找到矩陣中最長的遞增數列。這題其實超多方法：(1) 最直接的暴力法就是從每個點開始 BFS，需要 O(m²n²)；(2) Memorization + DFS 省去重複計算 O(mn)；(3) Topological sort 從 indegree = 0 點開始 BFS，需要 O(mn)。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*WsFsjhlGIPPe1wbcG5Xxcg.png" /></figure><p>所以其實不是 graph 的題目也可以想想看 topological sort，說不定會比較好做！</p><h3>#3 Dijkstra Algorithm</h3><blockquote>一種找 Weighted Graph 中最短路徑的 Greedy 演算法</blockquote><p>Greedy 的部分是它每次都去 search 當前算出來最小的那一條路。</p><p>實作上用 priority queue 來排序 <em>(distance, node)</em>，還需要一個 dist 陣列來存目前每個 node 最好的距離、adjacent list 來要每個 node 的鄰居。</p><h4>Dijkstra 模板</h4><pre>vector&lt;int&gt; dist(n + 1, INT_MAX);  <br>dist[start] = 0;<br><br>// pq to get the node with the smallest distance<br>priority_queue&lt;pair&lt;int, int&gt;, vector&lt;pair&lt;int, int&gt;&gt;, greater&lt;pair&lt;int, int&gt;&gt;&gt; pq;<br>pq.push({0, start});  // start node <br><br>while (!pq.empty()) {<br>    int curr = pq.top().second;<br>    int currDist = pq.top().first;<br>    pq.pop();<br>    <br>    // skip if not better<br>    if (currDist &gt; dist[curr]) continue;<br><br>    // update its neighbors<br>    for (auto&amp; nei : adjList[curr]) {<br>        int next = nei.first;<br>        int weight = nei.second;<br>        <br>        // relax the edge if a shorter path is found<br>        if (dist[curr] + weight &lt; dist[next]) {<br>            dist[next] = dist[curr] + weight;<br>            pq.push({dist[next], next});  // add this neighbor to pq<br>        }<br>    }<br>}</pre><h4><a href="https://leetcode.com/problems/network-delay-time/">743. Network Delay Time</a></h4><p>訊號跑過每個 node，找到最晚那個 node 到達的時間，若無法跑完則回傳 -1。所以 Dijkstra 跑完回傳 dist 中最大的 element 就可以。</p><h3>其他一般的 Graph 題目</h3><p>除了以上幾個特殊方法，其他的 graph 問題大多是 DFS/BFS 的問題、有的配合 backtracking (回溯法)、cycle 的檢查。</p><h4><a href="https://leetcode.com/problems/course-schedule/">207. Course Schedule</a></h4><p>Graph 最最經典題！除了 topological sort，其實用最直覺的 DFS 就可以解。但很難想的就是 backtracking，畢竟存 visited 的 set 要隨著狀態更新。</p><p>另外一個想法是 cycle detection，因為有沒有 cycle 其實就代表能不能跑完、是不是 DAG。</p><pre>bool canFinish(int numCourses, vector&lt;vector&lt;int&gt;&gt;&amp; prerequisites) {<br>    unordered_map&lt;int, vector&lt;int&gt;&gt; m;<br>    for(auto&amp; pre : prerequisites){<br>        m[pre[0]].push_back(pre[1]);<br>    }<br><br>    unordered_set&lt;int&gt; visited;<br>    for(int i = 0; i &lt; numCourses; i++){<br>        visited.clear();<br>        if(!dfs(i, m, visited)) return false;<br>    }<br>    return true;<br>}<br><br>bool dfs(int i, unordered_map&lt;int, vector&lt;int&gt;&gt;&amp; m, unordered_set&lt;int&gt;&amp; visited){<br>    if(m.count(i) == 0) return true; // no pre<br>    if(visited.count(i) &gt; 0) return false;<br>    visited.insert(i);<br>    <br>    for(int pre : m[i]){<br>        if(!dfs(pre, m, visited)) return false;<br>    }<br>    visited.erase(i);<br>    m[i].clear();<br>    return true;<br>}</pre><h4><a href="https://leetcode.com/problems/clone-graph/">133. Clone Graph</a></h4><p>就是 new 一個一模一樣的 graph，直接想真的非常難構思做法，還記得我在當兵時整天想這題最後放棄，週末回家馬上查答案…</p><p>用 recursive 的做法是設計一個 clone( ) 讓他做 DFS，還要用一個 set 來判斷是否撞到已經出現的 node。此外，node 是在新 graph 還是舊 graph 得很清楚否則很容易新舊 graph 接在一起。</p><pre>Node* cloneGraph(Node* node) {<br>    unordered_map&lt;Node*, Node*&gt; m;<br>    if(node == nullptr) return nullptr;<br>    return clone(node, m);<br>}<br><br>Node* clone(Node* x, unordered_map&lt;Node*, Node*&gt;&amp; m){<br>    if(m.count(x) != 0) return m[x];<br><br>    Node* new_x = new Node(x-&gt;val);<br>    m[x] = new_x;<br>    for(Node*&amp; nei : x-&gt;neighbors){<br>        new_x-&gt;neighbors.push_back(clone(nei, m));<br>    }<br>    return new_x;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2ef856f28e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[學習筆記 | Binary Search]]></title>
            <link>https://medium.com/@berlinnn3388/%E6%BC%94%E7%AE%97%E6%B3%95%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-binary-search-df741059c592?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/df741059c592</guid>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Wed, 12 Mar 2025 07:19:15 GMT</pubDate>
            <atom:updated>2025-12-07T09:59:06.829Z</atom:updated>
            <content:encoded><![CDATA[<h4>Binary Search 模板</h4><pre>// 1 1 2 3 3 4 4 8 8<br>// l       m       r<br>//       &lt;-| (why move left: ...)<br>// l m r<br>//   |-&gt; (why move right: ...)<br>//     lr<br><br>int l = 0, r = nums.size() - 1; // or nums.size()<br>while(l &lt; r){<br>    int m = l + (r - l) / 2;<br>    if(**move-left**) r = m; // move left<br>    else l = m + 1; // move right<br>}<br>return l;</pre><p>if(**move-left**){...}：<strong>最關鍵也最難想的地方</strong>，要確認 ==的處理，還有缺失值、重複值等等的狀況。</p><h4>面試模板 (UMPIRE)</h4><ul><li><strong>Understand：</strong>閱讀題目敘述 -&gt; 確認測資 -&gt; <strong>*Clarify</strong> -&gt; 分析暴力解<br><strong>*</strong>(1) 目標是否在最左或最右 (2) 目標是否超出左右邊界 (3) 是否有可能找不到目標 (4) 是否有重複值 (5) size 是否有可能是 0、1、2</li><li><strong>Match：</strong>照順序排列 + 暴力解 O(n) -&gt; 高機率 BS</li><li><strong>Plan：</strong>講解優化的解法、預估時間空間複雜度。講解時建議利用註解紀錄一次 simple case (size 5–9) 的 l、r、m 如何更新，也要確認更新的區間不會遺漏目標。</li><li><strong>Implement：</strong>這時思緒應該清楚了，就是照著 BS 模板去寫，這至少能跑過上面的 simple case！</li><li><strong>Review：</strong>dry run 再一個 simple case + edge cases (上面澄清到的各種奇怪情況)。記得利用註解讓面試官跟上自已的腳步！</li><li><strong>Evaluate：</strong>Time / Space Complexity 通常是 O(log n) / O(1)。</li></ul><h4><a href="https://leetcode.com/problems/first-bad-version/description/">278. First Bad Version</a></h4><p>序列中出現第一個 X 之後都會是 X，要找出第一個 X 的位置。</p><pre>Input: OOOXX<br>Output: 4 (1-start)</pre><p>因為是要找到交界處，所以 m 找到 O 要往後找、X 要往前找。</p><pre>// simple case<br>// O O O X X<br>// l   m   r<br>//     |-&gt;<br>//      lm r<br>//     &lt;-|<br>//      lr<br><br>int l = 1, r = n;<br>while(l &lt; r){<br>    int m = l + (r - l) / 2;<br>    if(isBadVersion(m)) r = m;<br>    else l = m + 1;<br>}<br>return l;</pre><p>抄完模板就發現這樣就可以了欸！假如這題不保證有 X 出現，可以用<strong>「把 r 放最後面」</strong>的技巧，若找不到會收斂到 r 最後面！</p><pre>// edge case (no any X)<br>// O O O _<br>// l m   r<br>//   |-&gt;<br>//    lm r<br>//     |-&gt;<br>//       lr (X not found)</pre><h4><a href="https://leetcode.com/problems/single-element-in-a-sorted-array/description/">540. Single Element in a Sorted Array</a></h4><p>要找到只出現一次的數字。暴力解 O(n) + 有排好 -&gt; BS。</p><pre>Input: 1 1 2 3 3 4 4 8 8<br>Output: 2</pre><p>如果一邊有奇數個、另一邊偶數個數字，那孤單的數字就在奇數的那邊 (可參考<a href="https://www.youtube.com/watch?v=HGtqdzyUJ3k">教學影片</a>)。</p><p>像是以下這個例子，排除中間 m 以及它的夥伴，左邊剩 3 個數、右邊剩 4 個數，那應該就要往左邊搜尋，後面也是同理：</p><pre>//   1 1 2 3 3 4 4 8 8<br>//   l       m       r<br>//         * *<br>//. (3)&lt;-|   | (4)<br>//   -----------------<br>//   l m r<br>//   * *<br>//(0)| |-&gt; (1)<br>//   -----------------<br>//       lr -&gt; return 2</pre><p>這題起頭比較難，可以從長度短一點 (1、3、5) 去想。另外題目排序的意義應該只有讓兩個一樣數字排在一起，所以也不需要比較鄰居大小。</p><h4><a href="https://leetcode.com/problems/koko-eating-bananas/">875. Koko Eating Bananas</a></h4><p>Koko 等速率吃香蕉，一次只能吃同一個 pile 的香蕉，找出在 h 小時之內能吃完香蕉的最慢速率。</p><pre>Input: piles = [3, 6, 7, 11], h = 8<br>Output: 4<br>// time: 1 + 2 + 2 + 3 = 8</pre><p>上面的例子中速率可能的範圍是 [1, 11]，暴力法就是每個速率都試試看，也就是 O(n)。不過要得到這個 11 我們得偷看過一遍，那又變成 O(n) 了… 所以初始 l、r 根據測資限制 [1, 1e9] 而定！</p><pre>// 1 2 3 4 5 6 7 8 9 10 11<br>// l         m           r -&gt; time: 6 &lt; 8<br>//         &lt;-| (slower)<br>// -----------------------<br>// l   m     r             -&gt; time: 10 &gt; 8<br>//     |-&gt; (faster)<br>// -----------------------<br>//       l m r             -&gt; time: 8 == 8<br>//       &lt;-| (try slower)<br>// -----------------------<br>//      lm r               -&gt; time: 8 == 8<br>//     &lt;-| (try slower)<br>// -----------------------<br>//      lr                 -&gt; return 4<br><br>int l = 1, r = 1e9;<br>while(l &lt; r){<br>    int m = l + (r - l) / 2;<br>    int time = 0;<br>    for(int pile : piles) time += ((pile - 1) / m + 1); <br>                                // OR ceil(double(pile) / m)<br>    if(time &lt;= h) r = m; // try slower<br>    else l = m + 1;<br>}<br>return l;</pre><ul><li>計算 Koko 吃每個 pile 的時間要是<a href="https://medium.com/algorithm-solving/c-%E9%99%A4%E6%B3%95%E5%8F%96%E6%95%B4-c3050dea3cea">向上取整/無條件進位</a>。</li><li>因為是找最慢的可能速率， if(time == h) 還是要往下找找看！</li><li>若要檢測「多快都吃不完」的情況，可用<strong>「把 r 放最後面」</strong>技巧！</li></ul><h4><a href="https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/">34. Find First and Last Position of Element in Sorted Array</a></h4><p>找到指定數字出現的第一個和最後一個位置。其實如果有背也可以直接用 C++ STL <a href="https://cplusplus.com/reference/algorithm/lower_bound/">lower_bound()</a>、 <a href="https://cplusplus.com/reference/algorithm/upper_bound/?kw=upper_bound#google_vignette">upper_bound()</a>啦哈哈，不過這題值得好好體會。</p><pre>Input: nums = [5, 7, 7, 8, 8, 10], target = 8<br>Output: [3, 4]<br>Input: nums = [5, 7, 7, 8, 8, 10], target = 6<br>Output: [-1, -1] // not found</pre><p>基本上兩者只有在 nums[m] == target 的處理有差，往左會找到數字第一次出現的位置、往右會找到下一個不同數字開始的位置。</p><pre>if(nums.empty() || nums[0] &gt; target || nums[nums.size()-1] &lt; target) return {-1, -1};<br>vector&lt;int&gt; res;<br><br>// lower bound<br>// 5 7 7 8 8 10 (target: 8)<br>// l   m     r<br>//     |-&gt; (7 &lt; 8)<br>//       l m r<br>//       &lt;-| (8 == 8)<br>//      lm r<br>//     &lt;-| (8 == 8)<br>//      lr -&gt; return 3<br><br>int l = 0, r = nums.size() - 1;<br>while(l &lt; r){<br>    int m = l + (r - l) / 2;<br>    if(nums[m] &lt; target) l = m + 1;<br>    else r = m;<br>}<br>if(nums[l] == target) res.push_back(l); // 3<br>else res.push_back(-1);<br><br>// upper bound<br>// 5 7 7 8 8 10 (target: 8)<br>// l   m     r<br>//     |-&gt; (7 &lt; 8)<br>//       l m r<br>//         |-&gt; (8 == 8)<br>//           lr -&gt; return (5-1)<br><br>l = 0, r = nums.size() - 1;<br>while(l &lt; r){<br>    int m = l + (r - l) / 2;<br>    if(nums[m] &lt;= target) l = m + 1;<br>    else r = m;<br>}<br>if(nums[nums.size()-1] == target) res.push_back(nums.size()-1);<br>else if(nums[l - 1] == target) res.push_back(l - 1); // 4<br>else res.push_back(-1);<br><br>return res;</pre><ul><li>Lower bound 落在 0 的話可以正確處理；Upper bound 停在最後一格要檢查一下 (手動檢查或改用上述 「把 r 放最後面」方法)。</li></ul><h4><a href="https://leetcode.com/problems/count-the-number-of-fair-pairs/description/">2563. Count the Number of Fair Pairs</a></h4><p>找出 (lower ≤ 兩兩相加 ≤ upper) 的 pair 數。這題有點複雜囉。</p><pre>Input: nums = [0, 1, 7, 4, 4, 5], lower = 3, upper = 6<br>Output: 6 (including (0,3), (0,4), (0,5), (1,3), (1,4), (1,5))</pre><p>暴力解就是雙重迴圈 O(n²) 找到所有可能的 (i, j)。那如果有排序好的資料，(for each i) 用 BS 不就可以 O(log n) 更快找到分界點？</p><pre>// lower = 3, upper = 6<br>// 0 -&gt; need [3, 6] -&gt; countLess(6) - countLess(3) = 4 - 1 = 3 pairs<br>// 1 -&gt; need [2, 5] -&gt; countLess(5) - countLess(2) = 3 - 0 = 3 pairs<br>// 4 -&gt; need [-1, 2] -&gt; countLess(2) - countLess(-1) = 0 - 0 = 0<br>// 4 -&gt; 0<br>// 5 -&gt; 0<br>// 7 -&gt; 0<br><br>// countLess(3)<br>// 0 1 4 4 5 7<br>// l     m     r<br>//     &lt;-| (4 &gt; 3)<br>// l m r<br>//   |-&gt; (1 &lt; 3)<br>//     lr -&gt; return 2 - 1 = 1<br><br>// countLess(6)<br>// 0 1 4 4 5 7<br>// l     m     r<br>//       |-&gt; (4 &lt; 6)<br>//       l m   r<br>//         |-&gt; (5 &lt; 6)<br>//          lm r<br>//         &lt;-|  (7 &gt; 6)<br>//          lr -&gt; return 5 - 1 = 4<br><br>// ...</pre><p>所以時間複雜度就是：O(n log n) <strong>(sort)</strong> + n * O(log n)<strong> (BS)</strong> = O(n log n)。</p><pre>long long countFairPairs(vector&lt;int&gt;&amp; nums, int lower, int upper) {<br>    sort(nums.begin(), nums.end());<br>    return countLess(nums, upper) - countLess(nums, lower - 1);<br>}<br>long long countLess(vector&lt;int&gt;&amp; nums, int sum){<br><br>    long long count = 0;<br>    for(int i = 0; i &lt; nums.size(); i++){<br>        int target = sum - nums[i];<br>        int l = i + 1, r = nums.size();<br>        while(l &lt; r){<br>            int m = l + (r - l) / 2;<br>            if(nums[m] &lt;= target) l = m + 1;<br>            else r = m;<br>        }<br>        count += (l - i - 1);<br>    }<br>    return count;<br>}</pre><ul><li>因為有包含等於的狀況，而等於的數字可能有很多個，所以找到下一個數字開始位置比較好處理。</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df741059c592" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[學習筆記 | CUDA 實作 ORB-SLAM3]]></title>
            <link>https://medium.com/@berlinnn3388/orb-slam-%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-4d23d4979e77?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d23d4979e77</guid>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 07:08:56 GMT</pubDate>
            <atom:updated>2025-07-27T18:11:53.483Z</atom:updated>
            <content:encoded><![CDATA[<h3>前置作業</h3><h4>Source Code</h4><ul><li><a href="https://github.com/UZ-SLAMLab/ORB_SLAM3">ORB-SLAM3 官方程式碼</a></li><li><a href="https://github.com/yunchih/ORB-SLAM2-GPU2016-final">CUDA 版本的 ORB-SLAM2</a></li></ul><h4>Prerequisites</h4><ul><li>Ubuntu 20.04 + NVIDIA RTX A5000 + CUDA 11.2 + CuDNN 8.1.1。</li><li>OpenCV 4.8.0 with CUDA (見下方 Install OpenCV with CUDA)。</li><li>Pangolin 0.5 (viewer)、Eigen3 (線性代數)、DBoW2 (用於 loop closing)、g2o (graph)、Sophus</li><li>ORB-SLAM3 的環境還蠻複雜的，得自己多摸索一下。</li></ul><h4>OpenCV 4.8.0 with CUDA</h4><p>ORB-SLAM3 聲稱 “Required at leat 3.0. Tested with OpenCV 3.2.0 and 4.4.0”，我想說 OpenCV 要安裝就用新一點的版本吧！很多 GPU 加速影像處理的功能都是後面才加的，感覺這次可能會用上。</p><p><a href="https://docs.opencv.org/4.x/db/d05/tutorial_config_reference.html">OpenCV 4.0 以後所有 CUDA 加速的演算法都移到 <em>opencv_contrib</em></a>，所以在 cmake 的時候記得要設定 <a href="https://docs.opencv.org/4.x/db/d05/tutorial_config_reference.html#tutorial_config_reference_general_contrib"><em>OPENCV_EXTRA_MODULES_PATH</em></a> 這個參數。</p><p>大致上我是照著 <a href="https://github.com/zadobudak/Install-Opencv-4.7.0-CUDA-Ubuntu?tab=readme-ov-file">Install-Opencv-4.7-CUDA-Ubuntu</a> 這篇教學，不過 make 的時候會遇到大大小小的錯誤訊息。像是 (1) 類別被 <em>opencv、opencv_contrib</em> 重複定義，這時我們只要選擇一個 build 就可以 (2) CUDA architecture 的設定 (3) Python 的 bindings 可以不用 (4) CUDA_FAST_MATH、CUBLAS 等優化 CUDA 運算的函式庫。</p><p>最後試成功的設定如下 (其他的指令如同上面那篇教學)：</p><pre>cmake -D CMAKE_BUILD_TYPE=RELEASE \<br>      -D BUILD_opencv_python2=OFF \<br>      -D BUILD_opencv_python3=OFF \<br>      -D CMAKE_INSTALL_PREFIX=/usr/local \<br>      -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \<br>      -D BUILD_opencv_video=OFF \<br>      -D BUILD_opencv_tracking=ON \<br>      -D EIGEN_INCLUDE_PATH=/usr/include/eigen3 \<br>      -D WITH_OPENCL=OFF \<br>      -D WITH_CUDA=ON \<br>      -D CUDA_ARCH_BIN=8.6 \<br>      -D CUDA_ARCH_PTX=&quot;&quot; \<br>      -D WITH_CUDNN=ON \<br>      -D WITH_CUBLAS=ON \<br>      -D ENABLE_FAST_MATH=ON \<br>      -D CUDA_FAST_MATH=ON \<br>      -D OPENCV_DNN_CUDA=ON \<br>      -D WITH_QT=ON \<br>      -D WITH_OPENMP=ON \<br>      -D BUILD_TIFF=ON \<br>      -D WITH_FFMPEG=ON \<br>      -D WITH_GSTREAMER=ON \<br>      -D WITH_TBB=ON \<br>      -D BUILD_TBB=ON \<br>      -D BUILD_TESTS=OFF \<br>      -D WITH_EIGEN=ON \<br>      -D WITH_V4L=ON \<br>      -D WITH_LIBV4L=ON \<br>      -D WITH_PROTOBUF=ON \<br>      -D OPENCV_ENABLE_NONFREE=ON \<br>      -D INSTALL_C_EXAMPLES=OFF \<br>      -D INSTALL_PYTHON_EXAMPLES=OFF \<br>      -D OPENCV_GENERATE_PKGCONFIG=ON \<br>      -D BUILD_EXAMPLES=OFF ..</pre><p>如果 build 有成功，C++ 執行 cout &lt;&lt; cv::getBuildInformation()顯示的列表裡面可以找到 CUDA 相關的資訊：</p><pre>General configuration for OpenCV 4.8.0-dev ================<br>...<br>NVIDIA CUDA:                   YES (ver 11.2, CUFFT CUBLAS FAST_MATH)<br>    NVIDIA GPU arch:<br>    NVIDIA PTX archs:<br><br>cuDNN:                         YES (ver 8.1.1)<br>...</pre><h3>編譯 ORB-SLAM3</h3><p>首先跑過官方提供的 build.sh，接著就可以根據 CMakeList.txt 來 cmake，遇到問題就得要修修改改 CMakeList.txt 或是檢查套件安裝位置</p><pre>cd build &amp;&amp; cmake ..</pre><p>有成功就可以接著 make，順便過濾掉 Eigen3 套件的洗版：</p><pre>make -j$(nproc)</pre><p>有成功 build 就可以開始跑 ORB-SLAM！</p><p>可以從 Examples/Monocular/mono_euroc 開始玩看看，“mono_euroc” 代表在 EuRoC dataset 跑單目鏡頭的模式。</p><p>這裡有 <a href="https://github.com/MichaelBeechan/ORBSLAM3/blob/master/euroc_examples.sh">EuRoC 的參考指令</a>，不過在測試之前要先下載 EuRoC 資料集：</p><pre>wget http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/machine_hall/MH_01_easy/MH_01_easy.zip -O Datasets/EuRoC/MH01.zip&amp;&amp;unzip Datasets/EuRoC/MH01.zip -d Datasets/EuRoC/MH01 &amp;&amp; rm Datasets/EuRoC/MH01.zip</pre><p>執行官方提供的 ./Examples/Monocular/mono_euroc：</p><pre>./Examples/Monocular/mono_euroc ./Vocabulary/ORBvoc.txt ./Examples/Monocular/EuRoC.yaml Datasets/EuRoC/MH02 ./Examples/Monocular/EuRoC_TimeStamps/MH02.txt dataset-MH02_mono</pre><pre>num_seq = 1<br>file name: dataset-MH02_mono<br>Loading images for sequence 0...LOADED!<br><br>...<br><br>Saving trajectory to f_dataset-MH02_mono.txt ...<br>There are 1 maps in the atlas<br>  Map 0 has 243 KFs<br><br>End of saving trajectory to f_dataset-MH02_mono.txt ...<br><br>Saving keyframe trajectory to kf_dataset-MH02_mono.txt ...</pre><p>有跑出這樣代表成功了！如果想要看到 time stats，可以在 CMakeList 裡面定義預處理器巨集 (macro) 像是 add_definitions(-DREGISTER_TIMES)，這樣運行完 SLAM 會跑出像這樣的數據：</p><pre>TIME STATS in ms (mean | std)<br>OpenCV version: 4.8.0-dev<br>---------------------------<br>Tracking<br><br>ORB Extraction: 21.153 | 7.0342<br>Pose Prediction: 2.9255 | 1.2524<br>LM Track: 10.514 | 6.3675<br>New KF decision: 0.095718 | 0.17941<br>Total Tracking: -nan | -nan<br><br>Local Mapping<br><br>KF Insertion: 23.152 | 10.939<br>MP Culling: 0.213 | 0.11683<br>MP Creation: 67.563 | 28.596<br>LBA: 317.98 | 322.13<br>KF Culling: 31.269 | 26.67<br>Total Local Mapping: 438.26 | 361.08<br>---------------------------<br><br>LBA complexity (mean | std)<br>LBA Edges: 22796 | 15534<br>LBA KF optimized: 43.372 | 26.347<br>LBA KF fixed: 63.108 | 55.515<br>LBA MP: -nan | -nan<br><br>LBA executions: 360<br>LBA aborts: 25<br>---------------------------<br><br>Map complexity<br>KFs in map: 272<br>MPs in map: 10110<br>---------------------------<br><br>Place Recognition (mean | std)<br>Database Query: 2.5533 | 2.1895<br>SE3 estimation: 5.1011 | 7.1845<br>Total Place Recognition: 7.8704 | 8.7906<br><br>Loop Closing (mean | std)<br>Loop Fusion: -nan | -nan<br>Essential Graph: -nan | -nan<br>Total Loop Closing: -nan | -nan<br>...</pre><p>如果要開啟 GUI 視窗，把 System 建構子的 bUseViewer參數打開就可以，如果 GUI 跑不出來應該是 Pangolin 的問題。</p><h3>CUDA Implementation</h3><h4>CMakeList.txt</h4><p>為了增加自定義的 CUDA 加速功能，有參考<a href="https://github.com/SYSU-FishTouchers/ORB_SLAM3_MOKAI/blob/master/CMakeLists.txt">別人的 CMakeList</a>，但反覆修改 CMakeList 的過程還是很艱辛。以下是幾個值得一提的地方：</p><ul><li>CUDA 版本和 NVCC (用來編譯 CUDA 程式碼)</li></ul><pre>set(CUDA_TOOLKIT_ROOT_DIR &quot;/usr/local/cuda-11.2&quot;)<br>find_package(CUDA REQUIRED)<br>set(CUDA_ARCH_BIN &quot;86&quot;)<br>set(CMAKE_CUDA_COMPILER /usr/local/cuda-11.2/bin/nvcc)<br>message(STATUS &quot;CUDA_TOOLKIT_ROOT_DIR: ${CUDA_TOOLKIT_ROOT_DIR}&quot;)<br>message(STATUS &quot;CUDA Version: ${CUDA_VERSION}&quot;)<br>message(STATUS &quot;CUDA include dirs: ${CUDA_INCLUDE_DIRS}&quot;)<br>message(STATUS &quot;CUDA libraries: ${CUDA_LIBRARIES}&quot;)<br><br>set(CUDA_NVCC_FLAGS &quot;${CUDA_NVCC_FLAGS} -std=c++11&quot;)<br>set(CUDA_PROPAGATE_HOST_FLAGS OFF)<br>SET(CUDA_HOST_COMPILER /usr/bin/g++)<br>LIST(APPEND CUDA_NVCC_FLAGS &quot;--compiler-options -fno-strict-aliasing -use_fast_math&quot;) </pre><ul><li>cuda_add_library 包括自定義的 .hpp .cu 檔</li></ul><pre>cuda_add_library(${PROJECT_NAME} SHARED<br>src/System.cc<br>src/Tracking.cc<br>...<br>include/Kernels/Allocator.hpp<br>include/Kernels/Cuda.hpp<br>include/Kernels/Fast.hpp<br>include/Kernels/ORB.hpp<br>src/Kernels/Allocator.cu<br>src/Kernels/Cuda.cu<br>src/Kernels/Fast.cu<br>src/Kernels/ORB.cu<br>)</pre><ul><li>單獨編譯一個要測試的 CUDA kernel：</li></ul><pre>set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/src/Kernels)<br>cuda_add_executable(ORB<br>        src/Kernels/ORB.cu)<br>target_link_libraries(ORB ${PROJECT_NAME})</pre><h4>ORB Extraction (ORBextractor.h &amp; ORBextractor.cc)</h4><p><a href="https://github.com/UZ-SLAMLab/ORB_SLAM3/blob/master/src/ORBextractor.cc">ORB-SLAM3 原版</a>是用一般的迴圈來做 CPU 運算、網路上有看到有人寫了一個<a href="https://github.com/SYSU-FishTouchers/ORB_SLAM3_MOKAI/blob/master/src/cuda/Orb_gpu.cu">加速 ORB 特徵提取的 CUDA kernel</a>。看到 OpenCV 對於 CUDA 的支援越來越多，我想說那我直接拿 OpenCV 4.8.0 的<a href="https://docs.opencv.org/4.8.0/da/d44/classcv_1_1cuda_1_1ORB.html">cv::cuda::ORB</a>來用用看。</p><ul><li>OpenCV ORB 實作細節：cv::cuda::ORB::create()建立一個 ORB → 每次呼叫cv::cuda::ORB::detectAndComputeAsync()，其實它就整合了 keypoints、IC angle、descripter 等等的計算。</li><li>CUDA-Accelerated ORB 實作細節：分別設計出方便呼叫的 CUDA kernels，有整合<a href="https://github.com/SYSU-FishTouchers/ORB_SLAM3_MOKAI/blob/master/src/cuda/Orb_gpu.cu">前輩的方法</a>。</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNAop3azArbz100KJKTJhQ.png" /><figcaption>ORB Keypoints in ORB-SLAM3 / ORB Keypoints in OpenCV (cv::cuda::ORB)</figcaption></figure><p>簡單測試的結果就如同<a href="https://zhuanlan.zhihu.com/p/57235987">大陸人的說法</a>，OpenCV 提取的特徵點比較集中，ORB-SLAM3 的分布比較均勻，而特徵點均勻通常導致高的系統精度。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C42PAEbFuQ8H9DLpqlwwpg.png" /><figcaption>CUDA-Accelerated ORB Extraction in ORB-SLAM3 / ORB Extraction in OpenCV</figcaption></figure><p>用 NVIDIA Nsight Systems 來 profile 也可以來比較兩者差異，理論上應該是運算越並行化給 CPU 和 GPU 比較好，所以目前的方法在效率上並沒有比OpenCV 套件包好的還要好。</p><p>做到這裡，我也認知到，我關於這些計算機結構和系統的知識還明顯不足，所以尚未能夠找到原因並持續迭代優化這類 CUDA kernels。未來我想學習 AI + Systems 相關的課程例如 <a href="https://dlsyscourse.org/">10–714 Deep Learning Systems: Algorithms and Implementation</a> 來打好知識基礎。</p><p>以後有機會再回來更新進度！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d23d4979e77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[美國求職 | 2026 Summer | 北美 SWE/MLE 找實習]]></title>
            <link>https://medium.com/@berlinnn3388/2025-spring-%E6%8A%80%E8%A1%93%E9%9D%A2%E8%A9%A6%E6%BA%96%E5%82%99%E5%BF%83%E5%BE%97-a484c3b59311?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/a484c3b59311</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ml-engineer]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[interview-questions]]></category>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 12:48:30 GMT</pubDate>
            <atom:updated>2026-05-21T06:41:59.207Z</atom:updated>
            <content:encoded><![CDATA[<h3>前言</h3><p>2025/26 在美國找實習是真的很難，尤其對我這種沒工作經驗、沒身份的小白。除了想紀錄一下求職過程，也希望可以給後人一個參考！</p><h3>目錄</h3><ul><li><strong>2025/26 找實習總結<br></strong>- 個人背景<br>- 找工結果</li><li><strong>求職準備<br></strong>- 找方向<br>- 修履歷<br>- 刷利扣<br>- Networking</li><li><strong>面試準備<br></strong>- Domain Knowledge<br>- Coding<br>- BQ</li><li><strong>面試經驗分享<br></strong>- Nuro<br>- ByteDance<br>- NVIDIA<br>- Aurora<br>- Modular<br>- Panasonic<br>- Motional<br>- Google</li><li><strong>總結</strong></li><li><strong>Appendix<br>- </strong>Networking 對話模板<br>- Coding Interview 模板<br>- Career Events @ CMU<br>- 公司列表<br>- 好文整理</li></ul><h3>✦ <strong>2025/26 找實習總結</strong>✦</h3><h4>個人背景</h4><p>NTU + CMU MSCV、研究 * 1、實習 * 1 (經歷都是 CV/Embedded Systems)、沒有 CV 頂會、以前沒有刷過題。主要想要找自駕車/CV 的職缺。</p><h4>找工結果</h4><p>從 2025/8 一路到 2026/3，<strong>總共投了 268 家</strong>，結果如下：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*no5sf6irngaPiUcnor0Y6Q.png" /><figcaption>2026 Summer 找實習總結</figcaption></figure><p>解釋一下由於對大多一般的純軟 SWE 反感，所以能投的不多。250+ 拿到 7 個面試算不錯了！可惜沒在美國上岸而是去了台灣外商，寫這篇好像不是很有說服力哈哈，所以以下只是我個人的經驗分享！(怕被罵)</p><h3>✦ <strong>求職準備</strong>✦</h3><p>這裡分享還沒面試前的持續升級、投履歷的長期過程。在 2025–26 年的大環境下整個體驗很漫長、很迷茫… 希望以下的整理可以帶給讀者一些方向。</p><h4>找方向</h4><p>來美國前如果沒想好，就會像學測完要選科系一樣突然。</p><p>我一開始只知道大方向是 <strong>Tech + ML/CV/Software Engineer + 2026 Summer Intern</strong>，起初就是都可以的心態，反而很難深入到進面試 (至少 ML 相關的都很看 Domain Knowledge)，但太 Niche 又怕把自己的道路走窄… 一路上其實顛覆了很多認知，例如我原本以為可以去自駕車公司做 Perception Engineer 或是大廠做 ML Research Engineer，開始投履歷才發現這些 ML 偏研究職位根本是不可能 (沒 PhD 沒 Paper)；純 Software 原本也以為自己可以刷刷利扣上岸、就可以躺平，後來卻發現我只對能親身體會落地、有意義的產品有興趣；例如我以為美國職場薪資高、WLB、有意義，來了倒覺得新鮮人大概只能選一個… (十年前應該可以選兩三個)</p><p>狩獵範圍 (於找到實習時間點 2026/3/15)：</p><ul><li><strong>自駕車公司</strong> (Waymo/Tesla/Nuro/…) 的 ML Infra/Inference</li><li><strong>軟硬體整合 </strong>(NV/Qualcomm/Arm/…) 的 Software Engineer in ML</li><li><strong>軟體科技公司</strong> (Meta/Google/…) 的 Software Engineer (AI/ML Team)</li></ul><blockquote><em>Excluded：一般的 Software Engineer (不擅長+想碰 ML/CV)、Robotics/ML Research (沒發表+不想競爭)、不投 Data、不投 Quant、不要 LLM (欸 LLM Agent/Systems 職缺好多…可惜一點興趣都沒有)</em></blockquote><p>會做出這樣的選擇，很多部分是因為我就是一個跨領域的實踐家，回想過去都是對 ML/Software/Hardware/Robotics 交界的領域有興趣。所以不論是 ML + Hardware、ML + Software、ML + Robotics，不要純 ML (Research 路線) 或純 Software (軟體大廠路線) 就可以接受。</p><p>對於特別想去的公司，我會<strong>盡早 Connect 該公司學長姐</strong>來獲取第一手消息，也比較有機會發展成內推！(畢竟效力是<strong> 內推 &gt; 校招 &gt; 海投</strong>)</p><p><strong>釐清方向的方法：</strong></p><blockquote><strong><em>1. LinkedIn 上找校友</em></strong><em>：調查他的學術背景、過去經驗等等和現在職業的連結。如果看到有興趣的 Role Model 可以主動加好友，問自己好奇的問題甚至是邀約 Coffee Chat。</em><strong><em>還有機會順便拿內推！</em></strong></blockquote><blockquote><strong><em>2. 研究 JD：</em></strong><em>目標工作需要的技能點和工作內容 (像是我發現自駕車公司分很細，Perception、ML Infra、Planning 會用到的技能天差地遠)。</em></blockquote><blockquote><strong><em>3. Medium/小紅書/一畝三分地：</em></strong><em>有時可以看到產業的趨勢、有時是主觀的見解、有用偏門技巧。雖然販賣焦慮但乾貨多多！</em></blockquote><h4>投履歷</h4><p>關於寫 Resume 有很多要點，我自己認為最重要的是<strong>職位相關的技能要盡可能塞滿整個 Resume</strong>，畢竟要過 ATS (Applicant Tracking System) 或是抓 HR 的眼球就是得這樣；同時隨著個人認知的提升，即使是同個經歷也會有截然不同的詮釋，所以 Resume 也必須一路修修改改。</p><p>我一開始為了想表示技術深度而寫太 Specific，但其實對於 ATS/HR 為主的大規模校招 (Meta/Google/Amazon) 履歷應該<strong>以 Buzzword 輸出為主，等技術面試再表現細節！</strong>不過有些看硬實力 (NV/Waymo/Infra-heavy/小新創) 是各組 HM/Senior 直接找人，這種倒是要有實作細節才比較容易被撈上來 (我發現我很多都是走這個路線)。所以不同寫法要自己權衡！</p><p>精進 Resume 最有效的方式應該是找熟的學長姐問，但如果你跟我一樣誰都不敢問，可以從這些地方開始：</p><blockquote><em>1. 模仿 LinkedIn 上學長姐的履歷 (類似背景 + 目標更好)</em></blockquote><blockquote><em>2. </em><a href="https://www.cmu.edu/career/documents/sample-resumes-cover-letters/graduate_student_resume_guide_24.pdf"><em>CMU Grad Resume Guideline</em></a></blockquote><blockquote><em>3. </em><a href="https://www.vmock.com/"><em>VMock</em></a><em> 或 </em><a href="https://resumeworded.com/"><em>Resume Worded</em></a><em> 等 ATS Checker</em></blockquote><p>除了履歷之外，推薦裝修：<strong>LinkedIn</strong> (找厲害的前輩來模仿、找<a href="https://medium.com/ujs-playground/%E7%B5%A6%E5%A4%A7%E5%AD%B8%E6%96%B0%E9%AE%AE%E4%BA%BA%E7%9A%84-linkedin-%E7%B6%93%E7%87%9F%E5%85%A8%E6%94%BB%E7%95%A5-a6f4adf816e5">教學文章</a>)、個人網頁 (然而不走學術效益不高)、GitHub。</p><p>關於投履歷，看到新職缺就馬上海投了！刷職缺我會先刷 <a href="https://www.intern-list.com/?k=aiml">Jobright</a>、<a href="https://github.com/SimplifyJobs/Summer2026-Internships#we-love-our-contributors-%EF%B8%8F%EF%B8%8F">SimplifyJobs</a>、<a href="https://github.com/vanshb03/Summer2026-Internships">Vansh &amp; Ouckah</a> 的清單，再來可能 Handshake、LinkedIn、公司官網、校友網路。也可以划划看 <a href="https://www.wayup.com/member/jobs-listing/">Wayup</a> (美版 CakeResume，有些沒薪水)、 <a href="https://wellfound.com/jobs">Wellfound</a> (科技新創挖寶)。</p><blockquote><em>有些公司只能投一定數量職缺，可以換個信箱再投！</em></blockquote><h4>刷利扣</h4><p>網路上有很多學習資源，因為我不是專業的所以我就分享我自己的經驗。</p><p>在 2025 年不論是一般的 Software Engineer 還是 MLE、Robotics 領域的各種工程師很難不考 Coding！但意外我實際遇到考 LeetCode Style 的不多，多是根據具體職位的 Coding，所以要花多少時間就自己斟酌！</p><p>我自己是錄取到出國前 (2025/2–7) 多刷一些，先把最核心的 <strong>BLIND 75 </strong>刷過一輪，和大家一樣從 <a href="https://www.youtube.com/playlist?list=PLot-Xpze53ldVwtstag2TL4HQhAnC8ATf">NeetCode</a> 影片去慢慢理解，其中還遭遇當兵宿命，在軍營完成二刷！然後是照 <a href="https://hackmd.io/@meyr543/r1skFcvgY"><strong>分題型題目整理</strong></a> 分開練習各個主題、閱讀他人心得、整理筆記和模板 (<a href="https://medium.com/@berlinnn3388/%E6%BC%94%E7%AE%97%E6%B3%95%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-binary-search-df741059c592">學習筆記 | Binary Search</a>、<a href="https://medium.com/@berlinnn3388/%E6%BC%94%E7%AE%97%E6%B3%95%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-graph-b2ef856f28e0">學習筆記 | Graph</a>)。八月出國前累積到 90 (一刷) / 50 (二刷)，到上岸刷到 145 / 75。</p><p>對了關於程式語言，我選擇用 C++ 來刷題的原因是 (1)<a href="https://ilewu.medium.com/%E7%BE%8E%E5%9C%8B%E8%BB%9F%E9%AB%94%E6%B1%82%E8%81%B7%E5%BF%83%E5%BE%97-%E9%9B%BB%E8%85%A6%E8%A6%96%E8%A6%BA-%E8%87%AA%E9%A7%95-37e5614e46e1">自駕車/嵌入式系統多用 C++</a> (2)過去的實習/助教經歷是 C++ (3)當時其實也沒有很熟 Python。<br>他人心得都表示走 CV 得練 C++，我認同 C/C++ 底層的概念是必備，但現在<strong>我認為用 Python 刷題才是最佳解</strong>，而且要考 ML 實作都指定用 Python (連 NV 面試官都說很少碰 CUDA C/C++ 的，還指定考 Python)。</p><p>刷題小建議：</p><blockquote><em>1. 保持記錄的習慣！刷題會比較有動力，也方便以後調閱題目來複習。</em></blockquote><blockquote><em>2. 進階的例如 Design 題 (Design a Data Structure)、ML 實作題、System Design 建議先不用做！面試要考再練習吧！</em></blockquote><blockquote><em>3. 來米國之前不要直接歐印刷題！搞不好會發現自己根本不用刷題！</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9hz6D88yse8WA7yGmRnytg.png" /><figcaption><em>刷題紀錄：分類、做題時間、複雜度、日期、筆記</em></figcaption></figure><h4>Networking</h4><p>這個真的是越早認知越早行動越好，有很多面向的好處。</p><p>例如可以在 LinkedIn 上找目標企業工作的學長姐，和他們請教職涯選擇、課業或找工作的建議。在釐清未來方向的同時，如果有來有往可以保持聯絡，等新職缺出來再表達興趣，也可以考慮邀約 Coffee Chat，順便拿內推。<strong>職缺出來才開始找就太遲了！</strong></p><blockquote><em>我的心得是常常以為的 Role Model 聊一聊發現事情和想像中不一樣，調整自己的認知後再找新的模範學習，整個過程比自己摸索快很多！常常會感悟「原來還可以這樣」。</em></blockquote><p>此外鎖定學校或其他機構辦的 <strong>Career Fair</strong> (企業來學校擺攤) 和 Networking Event 也是必須的！我把我這一年參加的 CMU 的活動放在：<a href="#df9b">Appendix III. Career Events @ CMU (2025 Fall &amp; 2026 Spring)</a>。</p><p>到了美國就是要讓自己變特別，「有自信地耍怪/讓他人留下印象」算是我來美國很大的 Takeaway。遊戲規則內完全可以腦洞大開，大至<strong>帶個超炫砲作品即時 Demo</strong>，小至<strong>高檔紙印履歷</strong>也可以讓招募官為之一亮。</p><p>另一個個人的 Takeaway 是<strong>盡可能擴大 Networking 圈子，不是有目的性的求職手段，而是拓展視野和提升認知的機會！</strong>像是年初去了一個黑客松得以接觸 XR 相關的企業和人脈，進了圈子之後才認識 XR 並拿到 XR 的實習！！</p><h3>✦ <strong>面試準備</strong>✦</h3><h4>Domain Knowledge</h4><p>每個職缺看的技能很不一樣，像是我找的 SWE/MLE 像是估狗根本不問技術問題 (純考 Coding)、硬體廠/嵌入式系統會問 C/C++、ML 主要根據該組正在做的東西來考、Robotics 我沒面試到。</p><p>不過後來我有嘗試聚焦到<strong> ML Inference Optimization</strong> (或是說 HPC/ML Systems)，很容易就被問 Transformer 有哪些優化系統的方法，或是過去實習在 Intel 硬體上加速 CNN 的細節。我把筆記整理在：<a href="https://medium.com/@berlinnn3388/ml-systems-optimization-from-algorithm-to-silicon-4ae4dc434182">ML Systems Optimization: A Software Engineer’s Perspective</a>。</p><p>我自己認為通用的可以先準備，但大多拿到面試再瘋狂補 Domain Knowledge 比較有效率，具體而言可以<strong>整理成一個 Cheatsheet 方便複習和面試時查找</strong>，我自己是用 NotebookLM 分析 JD/Resume/公司/面試官 → 制定複習範圍和生成筆記 → 在 Notion 上整理筆記。</p><p>回顧起來，對於我的大多數面試 Domain Knowledge 都是最重要的，未來我猜也會越來越重要！我很感謝當時有修 <strong>CMU 10-714 (Deep Learning Systems)、15–642 (Machine Learning Systems) </strong>和自學 <strong>MIT 6.5940 (TinyML and Efficient Deep Learning Computing)</strong>，推薦後人選課也可以盡可能對齊找工需求。</p><p>盤點幾個常見的技能：</p><blockquote><strong><em>1. C/C++ (韌體/機器人)：</em></strong><em>有了基礎之後各種 OOP 概念其實還是會忘，似乎面試前再拼短期記憶就可以～可參考：</em><a href="https://medium.com/@berlinnn3388/%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-%E9%9D%A2%E8%A9%A6%E6%9C%83%E7%94%A8%E5%88%B0%E7%9A%84-c-c-8770d03f551c"><strong><em>學習筆記 | 面試會用到的 C++</em></strong></a><em>。</em></blockquote><blockquote><strong><em>2. ML：</em></strong><em>主要都是考</em><strong><em>個人經歷/該職缺相關</em></strong><em>的進階主題，每個人天差地遠，盡可能凸顯自身和公司該組別的 Match (不過有時真的面試才知道對不對口)。</em></blockquote><blockquote><strong><em>3. Systems：</em></strong><em>純系統的我不知道，ML + 系統可以準備好過去經驗的例子，過程發現了哪一種 Bottleneck 所以採取哪種優化策略等等。業界常用的框架像是 vLLM、Triton、NCCL 也可以了解一下。</em></blockquote><h4>Coding</h4><p>先說<strong> LeetCode 類型的 Coding</strong>，如果是面試 General SWE 會考，但是像我和周遭同學有鎖定專精領域 (ML Systems、Robotics、SLAM) 其實幾乎不會考 LeetCode！如果已經有刷一些題，面試前再複習 Coding Interview 流程就行！我的模板放在：<a href="#3feb"><strong>Appendix II. Coding Interview 模板</strong></a>。</p><p>那麼非 LeetCode 類型的題目？會和該職缺需要的 Domain Knowledge 相關，考前猜題就好！例如 LLM 可能要會手刻 Self Attention、CV 可能會有 Convolution、ML Inference 要準備 CUDA/C++ MatMul 等等。</p><h4>BQ</h4><p>一開始很疑惑其他前輩的心得很少提到 BQ，難道不重要嗎？經歷這次求職我可以很肯定地說：<strong>對，不重要</strong>。就我遇到的經驗來說，即使有考也是過過場那種… 啊如果你是 DS 或偏產品的當我沒說。</p><p>如果要認真準備 BQ，我是照著<a href="https://chitingliu.medium.com/2023-%E5%9C%A8%E7%A7%91%E6%8A%80%E6%A5%AD%E7%9A%84%E5%AF%92%E5%86%AC%E6%89%BE%E5%8C%97%E7%BE%8E%E8%BB%9F%E9%AB%94%E6%A5%AD%E5%AF%A6%E7%BF%92-db70912d851e"><strong>這位學長的方法</strong></a>準備，我頗認同他提到的 CARL 原則 (Context-Action-Result-Learning)，另外據說 Amazon 的 16 條 Leadership Principles 就是其他企業的超集，可參考<a href="https://docs.google.com/document/d/112HBiMNvu6TYbDUOfVRe_MS4A-fKaWYrpMlmnsiMNiA/edit#heading=h.bmwacy4ylksh"><strong>徹底擊碎行為問題</strong></a>。</p><h3>✦ 面試經驗分享✦</h3><p>下面的 OA 和面試經驗希望可以帶給學弟妹一點幫助！然而也要聲明我都有依據公司規定 (有的有簽 NDA)，真的很想說細節但網路上揭露不道德啊啊啊想知道更多可以私下問我喔。</p><h4>Online Assessment (OA)</h4><p>拿到了 <strong>5 * OA</strong> (TikTok、Adobe、IBM、Uber、Aurora) 過 1 個，差點全軍覆沒… 其實算是在意料之中，畢竟也知道很多公司是白嫖 OA 加上個人能力不足 (OA 都好難)，而且看起來都是一般純軟 SWE，所以沒有特別放在心上。</p><h4>Nuro</h4><p><strong>Position: </strong>Mapping &amp; Localization, Software Engineering Intern<br><strong>Timeline:</strong> 海投 (8/19) → HR Screen (8/21) → Interview (9/19) → No Offer</p><p>超早拿到第一個面試！Nuro 是我一直很欣賞的自駕車公司。</p><p>技術面試很緊湊，45 分鐘包括簡單介紹、C++ 問題 、Coding。C++ 有考到很細的 OOP 概念 (pure virtual vs. virtual、abstract factory、singleton)，其實我都回答不太出來，太難了。Coding 是一畝面經裡面都沒有的 Design a Data Structure 題目，不難但是時間緊迫加上不支援慣用的 C++ 新語法，而且因為心態崩了所以也沒發揮好。</p><p>這次面試的 Takeways 除了使我回去複習 C++ (因此有了這篇：<a href="https://medium.com/@berlinnn3388/%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-%E9%9D%A2%E8%A9%A6%E6%9C%83%E7%94%A8%E5%88%B0%E7%9A%84-c-c-8770d03f551c">學習筆記 | 面試會用到的 C++</a>)，更是重新評估自己適不適合 C++ 的軟體職缺 (機器人、嵌入式系統)，結論是我還是回去寫 Python 好了。</p><h4>ByteDance (TikTok)</h4><p><strong>Position: </strong>Software Engineer Intern, AI Model Optimization<br><strong>Timeline: </strong>LinkedIn (10/24) → Interview (11/12) → No Offer</p><p>裝修領英完 HR 就主動敲我了！就說領英是有用的！</p><p>乍看很符合自己的背景，面試了才知道他們組是在做 Audio 的，要優化的模型也都是 Transformer 或 Diffusion 那類，這塊我可以說是一無所知…他們用的分散式運算和 Triton 我也完全不熟…</p><p>背景相關的技術問題問完，Coding 是考手刻 Self-Attention。還好我早就預判到並貼在小抄上了，就直接寫出來哈哈哈，不過他考優化技術的時候我只回答到很表面 (以當時的知識量)，所以最後還是被刷掉了。</p><blockquote><em>現在回想起來，Transformer 優化他們應該想聽到系統層面的例如 vLLM/PagedAttention (KV cache、multi-user/request)、StreamingLLM (context window、attention sink)、Data/Model Parallelism；也可以從演算法層面去講例如 Quantization (W8A8→SmoothQuant、W4A16/weight-only →AWQ)、Pruning/Sparsity、Distillation、NAS。前者學習資源推薦 </em><a href="https://mlsyscourse.org/"><em>CMU 15–642</em></a><em>、後者推薦 </em><a href="https://hanlab.mit.edu/courses/2024-fall-65940"><em>MIT 6.5940</em></a><em>。</em></blockquote><h4>NVIDIA #1</h4><blockquote><em>至今都不知道這面試怎麼來的，9 月投了履歷 (有內推)，後面陸陸續續也有投、也有參加 CMU Career Event，但都是五個月前的事。點開入口網站發現誒怎麼還跳出另一個，原來拿到了兩個組的面試… 太幸運了！</em></blockquote><p><strong>Position: </strong>Software Engineering Intern, Core Computer Vision<br><strong>Timeline:</strong> 內推 → 1st Interview (1/16) → No Offer</p><p>面試官是一個歐洲老爹 HM，他們組是做 <a href="https://developer.nvidia.com/cv-cuda">CV-CUDA</a> 的，大概就是把 CV Pre/Post-Processing 搬到 GPU 上跑、和 Inference 整合 (深有體會因為我先前實習用破硬體，都是 CPU 前處理在卡)。</p><p>已經預想到 NV 技術問題一定問很深，面試前補了很多 Domain Knowledge 筆記、自我介紹簡報 (根據職缺高度客製化)。原想說筆記整理好了面試可以快速翻，不料面試開始自我介紹分享了螢幕，面試官就直接指著螢幕問技術問題，完全無法看小抄… 所以解釋概念就零零落落，但至少都還答得上來粗淺的部分；沒準備好的部分主要是 Serving 那塊 (vLLM、Triton)，後悔即使我沒相關經驗也應該去了解一下。</p><p>總體而言面試表現還不錯，他說我具備這個職位的 Ingredients，但不小心聊太久他說還要再約補面 Coding，<strong>然後過一週被告知被刷掉了??? </strong>雖然不太清楚發生了什麼，但總之面試體驗也不錯，簡報成功引導了大部分的問題方向，而且還從歐洲老爹學到 NV 內部的 Know-how。</p><h4>NVIDIA #2</h4><p><strong>Position: </strong>HPC Systems Performance Intern<br><strong>Timeline:</strong> 內推 → 1st Interview (2/4) → No Offer</p><p>面試直接被排到一個月之後，原來是要面 Director 級別的大咖… 為此面試前狂讀了三個整天 (筆記在這 <a href="https://medium.com/@berlinnn3388/ml-systems-optimization-from-algorithm-to-silicon-4ae4dc434182">ML Systems Optimization: A Software Engineer’s Perspective</a>)。因為從來沒做過大規模的 HPC 系統，不說 Multi-Node 連 Multi-GPU 都沒做過，也不太確定為什麼會邀請我來面試。</p><p>面試官是個墨西哥老爹 ，他說他是 Director 臨時有事所以被派來的 Senior Manager。開頭他先介紹他們 Team 是一個在做 Data Center 的巨大團隊，然後換我自我介紹，以為他會深入問技術問題，不料就直接鬼轉叫我分享興趣愛好 (類 BQ)，然後是 (終於正常點的) 叫我分享最近有趣的專題，我講了把 Unstructured Sparsity 運算放在 Tensor Core 跑的經驗，看起來有和面試官共鳴！</p><p>後面就是隨便聊聊公司文化、Jensen Huang、台灣 NV，不過問他實習生可能會參與的專案、要幾輪面試都不知道… 這輪面試就是純聊天，感覺是職缺滿了 HR 派一個人來聊天哈哈哈。這次完全沒被問技術問題，瘋狂補習整整三天卻沒派上用場很可惜！</p><h4><strong>Aurora</strong></h4><p><strong>Position: </strong>Software Engineering Intern, Autonomy Sensing<br><strong>Timeline:</strong> 海投 (11/5) → OA (12/8) → Interview (3/5) → Withdraw (3/13)</p><p>我最喜歡的自駕車公司之一，而且它在匹茲堡有很多 Career Fair 這種接觸的機會，當初投了以為沒了結果忽然又被邀請去面試～</p><p>整體感受起來是比較 Algorithm/MLE 的，過完一遍背景後情境題是「如何偵測路上忽亮忽暗的 Burning Vehicles」，後面就是一堆基礎 ML 問題 (loss function, overfitting, optimizer, transformer)，和我期待的工作性質不太一樣，有點可惜。不過倒是有和他聊 Long-Tail Events 並從中得到些我的Capstone 需要的東西！</p><p>過了第一關之後收到之後兩輪 Coding 的面試通知。其實我這時候已經收了 Offer 加上一直都害怕 Coding 面試，就選擇退出了，希望未來 NG 還有機會再來面試！</p><h4>Modular</h4><p><strong>Position: </strong>AI Kernel Engineering Intern<br><strong>Timeline:</strong> 海投 (2/1) → Interview I (3/9) → Interview II (3/16) → No Offer</p><p>很認同的矽谷 AI 新創，讓 ML 在不同硬體上的優化變簡單！(現在的 Tech Stack 堆疊太龐雜、NV 限縮了生態系發展)，它在這個圈子比較有名的是 Mojo (Language)、MAX (Inference Platform)、Mojo Compiler。</p><p>面試官是亞洲 HM 姨姨，看來我的故事主軸 (不同硬體上的 ML 優化、跨平台編譯) 和公司的宗旨和面試官頗有共鳴。看起來他很期待我加入，根本沒問多少技術問題，一陣誇誇之下可惜沒有什麼 Takeaway。</p><p>第二輪 Coding Interview 是個印度工程師，我猜是考 MatMul C++/CUDA，結果是考 ReduceSum 的各種變體，例如在 CPU 上利用每一個 Core 或是 GPU 上善用 Thread/Block 或 Shared Memory 之類的，想起來很簡單但做起來很難… 他會盡量提示，但聽不清楚印度口音所以多次誤會他的意思，而且很多時候都是他突然講一個方法，看看我能不能現場理解並實作出來，例如階級式的 256 → 128 → 64 → … 的 Reduce 方法。</p><p>面試完感想是 Modular 只收「非常聰明、善於轉化高階概念到實作、有想法」的人，跟其他家的感覺很不一樣，算是開開眼界了！</p><h4>Panasonic</h4><p><strong>Position: </strong>Software Engineering Intern<br><strong>Timeline:</strong> 海投 (1/9) → Recruiter (3/6) → Withdraw (3/16)</p><p>Panasonic Avionics 就是長榮的那個客艙電腦，我對那個 3D 飛行地圖有印象就投了～職缺上像是廣義的 Software Engineering 但 Recruiter 說這個是要做 Test 的，其實我沒有相關經驗，也問不出我哪裡有符合職缺。聊完之後還拿到面試，我總覺得沒興趣就自動退出了… <strong>這家有點不知道在幹麻，放在這裡給大家避個雷。</strong></p><h4>Motional</h4><p><strong>Position: </strong>2026 Summer Intern, Infrastructure<br><strong>Timeline:</strong> 海投 (2/7) → Interview I (3/10) → Withdraw (3/26)</p><p>又一個匹茲堡的自駕車公司～校招已經聊過三次了超熟，拿了一堆 Swag。</p><p>第一面 HM 看到我讀 CMU 就很開心，說他們公司旁邊新蓋了一棟 CMU Robotics Innovation Center 我可以搭校車來工作。然後介紹他們是做 Performance Tooling 的需要不怕 C++ 的人加入。(殊不知我有點怕…)</p><p>第二三面 Coding 排在兩週後，原本想說硬著頭皮去學個經驗，到最後壓力太大還是選擇退出了，可惜無法分享心得。</p><h4>Google TW</h4><p><strong>Position: </strong>Software Engineering Intern, Summer 2026<br><strong>Timeline:</strong> 內推 (11/18) → <strong>1st Interview (12/8)</strong> → <strong>2nd Interview (12/9)</strong> → HR Update (12/18) → <strong>Team Match (2/11–3/5)</strong> → HR Update (3/3) → HR Update (3/8) → Team Fit Talk (3/9) → <strong>Offer Get (3/15)</strong></p><p><strong>Google 拖超久不意外！</strong>面試完等到直接忘記有投這個職缺。我在 2023 年暑假參加 Google Hardware Product Sprint (推！)，對當時接觸的實習生印象是很溫馨、很多台大的學長姐，加上台灣有很多結合 Software + ML + Hardware 的組，認為在個人成長和人際上都是理想的環境。</p><p><strong>兩輪都是 45-min 英語面試。</strong>流程包括簡單自介 → Coding → BQ → QA，但其實除了 Coding 都是快速過個場哈哈哈… 第一題 Medium-Hard DP 賽局理論有點難想，但一想到就很好寫出來；第二題 Medium Graph 會用到拓樸排序，不難倒是講太從容被提醒時間；BQ 用美國學會的英語話術糊弄一下。</p><p>後來我有跟上海小姐姐 HR 要 Interview Feedback <strong>(要特別問！這種他說不方便寄信用電話說)</strong>，他說兩輪面試官都指出我的演算法和 Dry Run 講解特別好，總體來說進 Team Match 機率還是挺大的。</p><blockquote><em>Takeaway：大公司的結構式面試會</em><a href="https://www.tryexponent.com/blog/google-coding-interview-rubric"><em>根據多面向的 Rubric 評分</em></a><em>，所以盡量去顧全大局會比較好！我的策略是既然 Coding 硬實力不夠 (只練習 150 題 &lt;&lt; 1000+ 刷題魔人)，那麼</em><strong><em>跟面試官澄清問題、表達思路、確認的 Communication 基本分要拿到！</em></strong><em>我實際用的 Coding 面試模板放在</em><a href="#6e05"><strong><em>下面</em></strong></a></blockquote><p>面試完兩個月終於被通知進入 Team Match！實習生的 Team Match 跟正職差不多，就是 HR 會根據每個人的背景推薦給相關的組。預設其實就是等結果就好，但僅僅等待是我不可能接受的 (被美國求職市場洗禮…)，幾個可以做的像是 (1) 透露偏好 (那時我提 On-Device ML、TPU、AI Experience) 怕 HR 亂推薦 (2) 聯絡領英上的估狗人 (增加能見度和被撈機會) (3) 跟 HR 約時間更新進度 (得到很多消息是信裡不寫的！)</p><p>其實 3/3 跟 HR Talk 我就大概有個底了，那時說到雖然只有少少的組已經回覆，但有一個組把我排第一順位 — <strong>Android XR！！！</strong>超級驚訝台北有這個組因為它超新，一個月前我還在黑客松看 Android XR 的工作坊和現場 Demo (Google DeepMind 是贊助商)。</p><p>過了一週之後 HR 說應該沒有其他組了，就看我要不要收 Android XR，也安排了小小的 Talk 了解一下那個組在幹嘛～原本疑慮的點是新店辦公室和題目有點抽象，不過他說要搬到板橋了，而且聽起來工作自由度也蠻大、有機會對齊自己想做的題目，<strong>就決定接下 Google Offer 了！還是生日當天！！</strong></p><p>後面就是跑跑流程、講講薪資～～除了底薪還有租屋補貼、Relocation Fee (從美國飛回來)，以實習生來說薪資算是不錯！應該說挺高的！</p><h4>Others</h4><p>其實除了正規面試流程，我也有聯繫在創業的 CEO 學長問問情況 (不過主要是 Robotics Software)、利用父母人脈認識前輩、或是直接在 YC 找人 (但都沒有提供簽證)。但其實到頭來找到不錯的新創更難，好像還是大公司比較好進！只是近年來大公司少收人導致現在畢業即失業的模樣。</p><p>也有跟 HR 聊聊完就被刷掉的，像是說職缺滿了、只收學期間實習等等。</p><h3>✦ 總結✦</h3><p>今年美國找實習真不容易，還好最後台灣 Google 願意收我！！我即將會在板橋辦公室做 Android XR，請期待我的作品。</p><p>坦白說早在出國前我就觀察到自己的海歸傾向，沒有同儕那種異地打拼、撈錢的美國夢，但用力想台灣也只有幾個外商可以滿足我的理想生活 — 然後沒想到竟然就如願進台灣 Google 了！Google 是我心目中最理想企業之一，而且就算未來還想鬼轉出國聽說也有很多轉調機會。</p><p><strong>以結果來說，完全沒料到我會鬼轉到 XR 這個領域</strong>，一年前更不知道 Google 有在做 XR。認真追究起來我從大五的 HCI 工作坊聽到 XR → 去 MIT XR 黑客松 → 接觸 Meta/Google/Snap XR 團隊，也許最後也是因為這串經驗在 Team Match 被撈起來的… 體現了 Connecting the Dots 也激勵我繼續不要臉去嘗試、去 Networking、把手弄髒的原則！</p><p>而且荒謬的是我通篇主要是自駕車/ML 求職，Domain Knowledge 花了絕大多時間深入學習、累積經歷，然而最後面試上的卻是花最少時間的經典 Coding… 完全沒用到九成時間爆讀的知識，給我這個自以為可以規劃一切的 J 人上了重要一課。</p><h3>✦ Appendix✦</h3><h4>Appendix I. Networking 對話模板</h4><blockquote><strong><em>[1] 破冰<br>- 打招呼 → firm handshake → 閒聊一兩句 → 遞履歷</em><br></strong><em>*網路上看到說拿好一點的紙印履歷可以吸引注意！實測下來職業倦怠的 recruiter 摸到好的紙大多會很開心！</em></blockquote><blockquote><strong><em>[2] Short Pitch<br>- 排隊時做好功課，不建議自介式的 elevator pitch<br>- </em></strong>I’ve gone through the JD of [Machine Learning Engineer Intern at Arm]. you are looking for candidates being capable of [enable ML compute on Arm’s platform]. <br>- I am a first year master’s student in [computer science] and have work experience in [building and optimizing ML systems], which I think is a good match with the expectation.</blockquote><blockquote><strong><em>[3] 問問題<br>- </em></strong>Can you share me more about the teams inside your company? <br>- An example of projects that an intern may involve? <br>*<strong><em>對方是技術背景可以追問：</em></strong><br>- Favorite project that you most proud of?<br>- I saw news about [F1 racing cars built on Arm]. Can I ask you whether there are teams or projects that are relevant to [AI computing on vechicles]?</blockquote><blockquote><strong><em>[4] 離開前記住聯絡方式 <br>- </em></strong>What’s the best way to connect with you if I have further questions?<br><em>*加 LinkedIn，回家後可以 Follow-up</em></blockquote><h4>Appendix II. Coding Interview 模板 (UMPIRE)</h4><blockquote><strong><em>[1] Understand</em><br><em>- 閱讀題目敘述 → Clarify → 分析暴力解法複雜度</em><br></strong><em>*問清楚：</em>input/output constraints? 找不到答案 return -1? size = 0, 1, 2? duplicates? positive? int? <strong><br></strong>- “May I take a moment to read it &amp; ask a few clarifications?”<br>- “I think a naive solution is … which is not ideal. I assume by posting this question, you want me to find an efficient solution.”</blockquote><blockquote><strong><em>[2] Match<br>- 講講看暴力解法，觀察題目特性來推論優化解法<br></em></strong><em>*特性：</em>sorted, repeat, memory-heavy, recursion call stack<em><br>- 估算優化後的時間/空間複雜度</em></blockquote><blockquote><strong><em>[3] Plan</em><br><em>- 用 Simple Case 講解優化演算法<br></em></strong><em>*Think out loud、筆記寫清楚 (善用排版、畫圖等示意方法)</em><br><em>- “Let me walk through the simple case first to verify correctness. I’ll review edge cases afterwards”</em></blockquote><blockquote><strong><em>[4] Implement</em><br></strong><em>- 開始寫扣，至少能跑過上面的 Simple Case<br>*保持與面試官的互動，不要埋頭狂寫！</em><br>- “I’ll start coding based on the plan we discussed”<br>- “Let me rewrite this part (helper function) to be cleaner”<br>- “Let me know if you prefer a different structure here”<br>- “You kind of gave me a hint already by saying …”<br>- “Let me verify something before I continue”<br>- “This part isn’t handling duplicates properly — I see why it could fail”<br>- “Am I in the right direction?”</blockquote><blockquote><strong><em>[5] Review<br></em></strong><em>- Dry Run 看看有沒有遺漏的<br>- 面試官這時可能會提出幾個還沒討論到的 Edge Cases</em></blockquote><blockquote><strong><em>[6] Evaluate<br>- </em></strong><em>時間/空間複雜度 (進階：分析 Trade-offs)<br>- 面試官的 Follow-ups</em></blockquote><h4>Appendix III. Career Events @ CMU (25 Fall — 26 Spring)</h4><h4>Career Fair</h4><blockquote><strong><em>- STEM Career Fair (2025/9/9–9/11)：</em></strong><em>最大的，三天來的公司大多都是 AI 新創 / 機器人新創 / Quant。我聊到的有 Arm、Ambarella、Onward Robotics、Symbotic、C3 AI、Suno，可惜原本有興趣的汽車/航太像是 Ford、Boeing、Mitsubishi 都沒簽證或沒軟體職缺。大家的心得都是會場太多人而且公司弱弱的，但依舊是一個有趣的體驗。</em></blockquote><blockquote><strong><em>- SCS Robotics Opportunity Expo (2025/10/3)：</em></strong><em>Pittsburgh Robotics Network 辦的就業博覽會，聊到的有 North Earth Autonomy (UAV 空中地圖的處理有用到 CV)、Omnicell (取代藥師的機器人)、Aethon (醫院裡面用 LiDAR 的 mobile robot)、Motional (自駕車)、HEBI Robotics (模組化機器人開發的平台)，人沒有很多而且都聊得很深入，整體氣氛還不錯。</em></blockquote><blockquote><strong><em>- Pittsburgh Robotics &amp; AI Discovery Day (2025/11/5)：</em></strong><em>和上面的差不多只是在超大的展覽館，包括 BloomField (農機)、Aurora、Motional、RealSense 等等。</em></blockquote><blockquote><strong><em>- STEAM Career Fair (2026/2/12)：</em></strong><em>相比秋季的小很多，認識很有潛力的新創 Cerebras、SpreeAI。</em></blockquote><blockquote><em>往年景氣好的時候校招可以收穫一大把面試，但今年看起來不太妙，我自己沒有因為 Career Fair 拿到半個面試哈哈哈嗚嗚嗚。而且感覺今年機器人新創看似都是等到 2–4 月才開始收暑期實習。</em></blockquote><h4>Employer Session</h4><blockquote><em>大的知名的公司都會直接來學校辦個大的，活動資訊會來自於 Handshake (學生版領英)、</em><a href="https://www.cs.cmu.edu/calendar/"><em>SCS 網站</em></a><em>、公司官網等等，要頻繁去刷然後報名！</em></blockquote><blockquote><strong><em>Networking Event</em></strong><em> (NVIDIA、Tesla、Apple)：會根據有興趣的組來安排一對一聊天，NVIDIA 聊到一個 Robotics DL 的組，聊了聊 TensorRT；其他兩家感覺都是來招 Firmware/Silicon，完全是 ECE 的戰場。</em></blockquote><blockquote><strong><em>Career Talk</em></strong><em> (Databricks、Adobe、XPeng、Meta、OpenAI)：聽聽講座看公司最近在做什麼，但就沒有一對一或投履歷環節。</em></blockquote><h4>Appendix IV. 公司列表</h4><h4><strong><em>Autonomous Vehicles</em></strong></h4><blockquote><em>Waymo、Nuro、Zoox、Aurora、Tesla、Ambarella、Motional、ArgoAI、Aptiv、Oshkosh、Rivian、XPeng、PonyAI、Bosch、MERL、HRI、HATCI</em></blockquote><h4>Software</h4><blockquote><em>Google、Meta、Amazon、Microsoft、IBM、Adobe、ByteDance</em></blockquote><h4>Robotics</h4><blockquote><em>Intuitive、Symbotic、Skild AI、Field AI、Onward Robotics、Skydio、Near Earth Autonomy</em></blockquote><h4>Hardware / Electronics</h4><blockquote><em>NVIDIA、Qualcomm、Apple、Arm、AMD、Intel、Samsung、Marvell、Dell、HP、Sony、Panasonic、Nokia</em></blockquote><h4>Appendix V. 好文整理</h4><h4><strong>CV/MLE Intern</strong></h4><blockquote><strong><em>- (2018, UMich ECE, CV/SLAM)</em></strong><em> </em><a href="https://ilewu.medium.com/life-in-u-mich-%E6%89%BE-summer-intern-%E5%BF%83%E5%BE%97-545df8e0831"><em>Life in U-Mich &amp; 找 Summer Intern 心得</em></a><em>、</em><a href="https://ilewu.medium.com/%E7%BE%8E%E5%9C%8B%E8%BB%9F%E9%AB%94%E6%B1%82%E8%81%B7%E5%BF%83%E5%BE%97-%E9%9B%BB%E8%85%A6%E8%A6%96%E8%A6%BA-%E8%87%AA%E9%A7%95-37e5614e46e1"><em>美國軟體求職心得 (電腦視覺/自駕)</em></a><em>、</em><a href="https://ilewu.medium.com/computer-vision-job-hunting-faq-3ea3d78f3778"><em>美國軟體求職 FAQ (電腦視覺領域)</em></a><em><br></em><strong><em>- (2019, CMU MSCV, CV/DL)</em></strong><em> </em><a href="https://medium.com/@bill800227/%E7%BE%8E%E5%9C%8B%E7%94%9F%E6%B4%BB-%E6%BA%96%E5%82%99%E5%AF%A6%E7%BF%92%E9%9D%A2%E8%A9%A6%E7%B4%80%E9%8C%84-cb8c334da457"><em>[美國生活] 準備實習面試紀錄</em></a><em><br></em><strong><em>- (2020, CMU MRSD, CV/SLAM) </em></strong><a href="https://medium.com/momo%E7%9A%84%E6%A9%9F%E5%99%A8%E4%BA%BA%E7%95%99%E5%AD%B8%E5%A4%A2/%E5%8C%97%E7%BE%8E-%E8%87%AA%E9%A7%95%E8%BB%8A-2020%E6%9A%91%E6%9C%9F%E5%AF%A6%E7%BF%92%E9%9D%A2%E8%A9%A6-covid-19-f12ea933f658"><em>北美｜自駕車｜2020暑期實習面試｜COVID-19</em></a></blockquote><h4>SWE Intern</h4><blockquote><strong><em>- (2021, SWE) </em></strong><a href="https://seattao.medium.com/%E6%88%91%E8%A6%81%E6%8B%BF%E5%A4%A7%E5%BB%A0offer-%E7%AC%AC%E4%B8%80%E5%9B%9E-%E7%BE%8E%E5%9C%8B%E7%A7%91%E6%8A%80%E6%A5%AD%E5%AF%A6%E7%BF%92%E7%9A%84%E5%85%A8%E9%9D%A2%E4%BB%8B%E7%B4%B9-%E4%B8%8A-a9f714d6fc24"><em>我要拿大廠offer! 第二回、美國科技業實習的全面介紹（上）</em></a><em>、</em><a href="https://seattao.medium.com/%E6%88%91%E8%A6%81%E6%8B%BF%E5%A4%A7%E5%BB%A0offer-%E7%AC%AC%E4%BA%8C%E5%9B%9E-%E7%BE%8E%E5%9C%8B%E7%A7%91%E6%8A%80%E6%A5%AD%E5%AF%A6%E7%BF%92%E7%9A%84%E5%85%A8%E9%9D%A2%E4%BB%8B%E7%B4%B9-%E4%B8%8A-b5c500f606d"><em>我要拿大廠offer! 第三回、美國科技業實習的全面介紹（下）</em></a><em><br></em><strong><em>- (2020, UMich ECE, SWE)</em></strong><em> </em><a href="https://jaycho2007.medium.com/2020-%E5%A4%8F-%E8%BB%9F%E5%B7%A5%E5%AF%A6%E7%BF%92-%E7%A7%8B%E6%8B%9B-%E5%B0%8F%E8%A8%98-88fbcb2d8671"><em>2020 北美軟工實習小記 -前篇</em></a>、<a href="https://jaycho2007.medium.com/2020-%E8%BB%9F%E5%B7%A5%E5%AF%A6%E7%BF%92%E5%B0%8F%E8%A8%98-%E5%BE%8C%E7%B7%A8-bd83d1091859"><em>2020 北美軟工實習小記 -後篇</em></a><em><br></em><strong><em>- (2020, UCLA MSCS, SWE)</em></strong><em> </em><a href="https://medium.com/@adrianhsu/%E5%8C%97%E7%BE%8E-2020-summer-sde-intern-3ab235cf0a5a"><em>北美 2020 Summer SDE Intern 面試心得</em></a></blockquote><h4>ML/CV New Grad</h4><blockquote><strong><em>- (2024, UCSD ECE, CV/Robotics) </em></strong><a href="https://medium.com/@tsaolin/%E4%B9%BE%E8%B2%A8%E6%BB%BF%E6%BB%BF-2024-new-grad-in-machine-learning-computer-vision-robotics-%E5%8C%97%E7%BE%8E%E6%AD%A3%E8%81%B7%E9%9D%A2%E8%A9%A6%E7%B6%93%E9%A9%97%E5%88%86%E4%BA%AB-e11c8882dbc7"><em>【乾貨滿滿】2024 New Grad in Machine Learning | Computer Vision | Robotics 北美正職面試經驗分享</em></a><em><br></em><strong><em>- (2020, CMU MRSD, CV/Robotics) </em></strong><a href="https://medium.com/@dunghanl/%E7%BE%8E%E5%9C%8B-%E8%87%AA%E9%A7%95%E8%BB%8A-2020%E6%AD%A3%E8%81%B7%E9%9D%A2%E8%A9%A6%E7%B6%93%E9%A9%97-1a457d418b36"><em>美國 | 自駕車 | 2020正職面試經驗</em></a></blockquote><h4>SWE New Grad</h4><blockquote><strong><em>- (2022, UCB EECS, SWE)</em></strong><em> </em><a href="https://medium.com/mencher-publication/2022-new-grad-%E5%BE%8C%E7%96%AB%E6%83%85%E6%99%82%E4%BB%A3%E6%89%BE%E5%B7%A5%E4%BD%9C-e849769885e2"><em>2022 New Grad 後疫情時代找工作</em></a><em><br></em><strong><em>- (2025, UIUC MCS, SWE)</em></strong><em> </em><a href="https://medium.com/@karta15025452/2025%E7%BE%8E%E5%9C%8Bcs-new-grad%E6%89%BE%E5%B7%A5%E5%BF%83%E5%BE%97-b4890affca54"><em>2025美國CS New Grad找工心得</em></a></blockquote><h4>TW 外商</h4><blockquote><strong><em>- (2024, NTU CSIE, MLE) </em></strong><a href="https://jackchen890311.github.io/2025/07/01/fulltime-2025/#%E9%9D%A2%E8%A9%A6%E7%B4%80%E9%8C%84"><em>2025 年科技業正職預聘/研替面試心得</em></a><em>、</em><a href="https://jackchen890311.github.io/2024/06/28/summer-intern-2024/index.html"><em>2024 年科技業暑期實習面試心得</em></a>、<a href="https://jackchen890311.github.io/2025/11/01/interview-with-piccollage/"><em>My Interview Experience with PicCollage</em></a><em><br></em><strong><em>- (2023, NTUST CSIE, SWE)</em></strong><em> </em><a href="https://www.dcard.tw/f/tech_job/p/242709401"><em>2023資工系普通人軟體工程師實習面試心得</em></a><strong><em><br>- (2023, NYCU CS, SWE)</em></strong><em> </em><a href="https://medium.com/@yojahuang/2023-google-swe-intern-%E9%9D%A2%E8%A9%A6%E5%BF%83%E5%BE%97-2ee4baad0321"><em>2023 Google SWE Intern 面試心得</em></a><em><br></em><strong><em>- (2023, NTU CSIE, SWE)</em></strong><em> </em><a href="https://casperwang.pages.dev/archives/2023-01-19-google_interview/"><em>Google SWE Intern 面試</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a484c3b59311" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[美國留學 | CV/CS/ECE 碩士申請]]></title>
            <link>https://medium.com/@berlinnn3388/2024-fall-%E8%B7%A8%E9%A0%98%E5%9F%9F%E7%94%B3%E8%AB%8B%E7%BE%8E%E5%9C%8Bcs-ece%E7%A0%94%E7%A9%B6%E6%89%80%E5%BF%83%E5%BE%97-f85e543f40a3?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/f85e543f40a3</guid>
            <category><![CDATA[meng]]></category>
            <category><![CDATA[美國研究所]]></category>
            <category><![CDATA[心得分享]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[跨領域申請]]></category>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Sat, 11 Jan 2025 15:25:13 GMT</pubDate>
            <atom:updated>2025-10-24T00:43:08.003Z</atom:updated>
            <content:encoded><![CDATA[<h3>前言</h3><p>Hi 我是 Berlin！在台大跌跌撞撞四年之後，我錄取了夢想中的 <strong>CMU Master of Science in Computer Vision (MSCV), School of Computer Science (SCS)</strong>，準備開始我的美國留學之旅。</p><p>這篇文章想跟你分享的，正是作為一個平凡的非電資理工學生，是如何找到適合自己的選校策略，並成功斬獲來自 CMU、UCLA、UCSD 的滿手 Offer？又是掌握了什麼訣竅，讓我得以突破學術背景的限制，將看似雜亂的跨領域經驗奏出奇效？</p><h3>目錄</h3><ul><li><a href="#a267"><strong>2025 Fall 申請總結</strong></a><br>- 個人背景<br>- 申請結果</li><li><a href="#f0b0"><strong>選校</strong></a><strong><br>- </strong>我的選校策略<br>- 校系介紹</li><li><a href="#f0b0"><strong>申請資料準備</strong></a> <br>- 成績單<br>- GRE/TOEFL<br>- CV<br>- SOP<br>- PS/PHS/Additional Essay<br>- 推薦信<br>- Video Essay<br>- 個人網站/LinkedIn/GitHub</li><li><a href="#65f1"><strong>準備時程和花費</strong></a><strong><br>- </strong>最後一年時程規劃<br>- 留學申請花費</li><li><a href="#ca83"><strong>其他補充</strong></a><strong><br></strong>- 我現在才大二/大三，我可以如何準備？<br>- 是否推薦留學代辦/Editor<br>- Legacy Admissions 現況<br>- 跨領域申請心得<br>- 我踩過的坑<br>- 關於壓力和心態調適<br>- 送出申請了，然後呢？</li><li><a href="#dcf9"><strong>結語</strong></a></li></ul><h3>✦ <strong>2025 Fall 申請總結</strong>✦</h3><h4><strong>▌</strong>個人背景</h4><p>相比於多數 CS 本科申請者，我修過很少必修課、學術研究不算深入、技能點很雜，但最終還是有不錯的結果。所以寫這篇文章也是希望可以給類似屬性的同學多一些參考，以下提供我的背景資料：</p><h4><strong>[Education]</strong></h4><p>- NTU (B09) B.S. in Biomechatronics Engineering<br>- GPA: 4.03/4.3, CS-Related: 4.20/4.3<br>- 領域專長：Artificial Intelligence</p><h4><strong>[Test Scores]</strong></h4><p>- TOEFL: 105 (R30 L27 S21 W27)<br>- GRE: 322 (V152 Q170 AW4.0)</p><h4><strong>[Research Exp.]</strong></h4><p>- 1 * RA (CV + Edge Computing / 2.5 yr)</p><h4><strong>[Work Exp.]</strong></h4><p>- 1 * SWE/MLE Intern (CV + Edge Computing / 3 m)<br>- 3 * TA (Computer Programming Language, Practical Data Structures and Algorithms, Intro to Artificial Intelligence)</p><h4><strong>[Publications]</strong></h4><p>- 2 * Biomechatronics 小研討會<br>- 2 * Bioengineering 國際研討會</p><h4><strong>[Honors &amp; Awards]</strong></h4><p>- 2 * Dean’s List Award (書卷獎)<br>- 研究計畫 Fellowship、Scholarship、論文獎、競賽</p><h4><strong>[Leadership]</strong></h4><p>- 國際學生志工、杜鵑花節總召、營隊總召</p><h4><strong>[Recommendation]</strong></h4><p>- 專題指導教授 (Cornell) (修課 x2, TA x1)<br>- 系主任 (Stanford) (修課 x3, TA x2)<br>- 實習主管</p><p>筆者畢業於台大生物機電工程學系。如果你沒聽過生機系，可以想像成整合機械 (50%)、電機 (25%)、CS (15%)、生物 (10%) 的跨領域工程科系，因此我們系學生的去向超級廣，從 Robotics、ME、EE、ECE、CS、DS 到 BME、Bioinformatics 都大有人在！</p><p>我不習慣把正式課程作為我的主要學習方式，因此 CS 課還真沒上過幾個；倒是在課外累積了大大小小的專題、研究、實習經驗，也因為這些經驗，使我得以從實踐中探索到我對於 CV+Embedded Systems 的興趣。</p><h4><strong>▌</strong>申請結果</h4><ul><li><strong>Admitted<br></strong>- CMU MS CV<br>- CMU MS AIE — ECE<br>- UCSD MS ECE (EC79: Computer Engineering)<br>- UCSD MS CSE (CS75: Computer Science)<br>- UCLA MEng (AI track)</li><li><strong>Rejected<br></strong>- Cornell Tech MEng CS<br>- Stanford MS EE<br>- UC Berkeley MEng EECS (Visual Computing track)</li><li><strong>Decision<br>- CMU MS CV</strong></li></ul><h3>✦ 選校✦</h3><h4><strong>▌</strong>我的選校策略</h4><p>我主要傾向於<strong>申請就業型、修課型</strong>，<strong>不選研究型</strong>。</p><p>我的背景比較跨領域、經歷也有點廣，最後是選 <strong>Top 30 學校 MEng + 非正統 MSCS Title </strong>(例如 ECE、CV、AI)。也考量到學術氛圍、地理位置、留學體驗，沒選傳統的工科強校 (UIUC、UMich、Purdue、GT)。</p><p><strong>選校時建議參考的資源 (*推薦)：</strong></p><ul><li><strong>學校排名：</strong><a href="https://www.usnews.com/best-colleges/rankings/national-universities?_sort=rank&amp;_sortDirection=asc"><strong>*U.S.News</strong> (綜排)</a>、<a href="https://csrankings.org/#/fromyear/2014/toyear/2024/index?all&amp;us"><strong>*CSRankings</strong> (專排)</a>、<a href="https://www.topuniversities.com/world-university-rankings">QS (綜排)</a><br>- 和學校名聲、研究成果、資金資源比較相關。<br>- 因為不是走研究路線，所以評估研究產出的指標就和我沒關係。<br>- 畢竟還是希望校名可以帶來優勢/有面子一點，可以分外行人 (台灣雇主、長輩) 和內行人 (教授、同行) 去討論學校名聲對自己的影響。</li><li><strong>CS 錄取難度：</strong><a href="https://opencs.app/grade/"><strong>*OpenCS</strong></a>、<a href="https://zhuanlan.zhihu.com/p/679367620">大陸人整理</a>、<a href="https://offerland.cc/results">OfferLand (台灣人)</a>、<a href="https://offer.1point3acres.com/results">Offer多多 (大陸人)</a>、<a href="https://www.thegradcafe.com/survey/">GradCafe (老外)</a><br>- 要注意台灣學生和大陸學生根本就被分在不同 Pool 裡面篩選，所以台灣身份會比大陸有優勢，因此別看到大陸學生落榜而沒自信！<br>- 女生加分的有 CMU SCS (<a href="https://www.cmu.edu/news/stories/archives/2016/september/undergrad-women-engineering-computer-science.html">48%</a>)、Cornell、NYU。 <br>- 雖然大家都說 CS 領域越來越競爭，但也要考慮其他時空背景資訊 (研究經費政策導致 2025 年招較多碩士生、<a href="https://medium.com/mencher-publication/2021-fall-cs-ms-%E7%94%B3%E8%AB%8B%E7%B6%93%E9%A9%97%E5%88%86%E4%BA%AB-%E4%B8%8A%E7%AF%87-%E7%B5%90%E6%9E%9C%E7%B8%BD%E8%AB%96-30e40092a4cf">2021 年疫情爆發地獄難度</a>)。</li><li><strong>就業表現：</strong><a href="https://www.forbes.com/top-colleges/">Forbes</a>、<a href="https://www.f1hire.com/ranking">F1 Hire</a>、<strong>*各校就業報告</strong> (e.g. <a href="https://www.cmu.edu/career/outcomes/post-grad-dashboard.html">CMU</a>)<br>- 每個學校對於就業的支持其實落差很大，可以漸漸接觸工作簽證 (CPT、OPT、H1B)、Career Fair、地理位置等等資訊。</li><li><strong>留學體驗：</strong>一畝三分地、Medium、PTT、Dcard、Youtube<br>- 想體驗度假般的留學生活可以考慮 UCSD、UCLA 等學校。<br>- 可以先計算學費、生活費、預期薪資來評估留學花費。</li></ul><p>我最後投了 8 間，實際申請後感覺可以其實投到 10–12 間碰碰運氣，畢竟有些學校錄取標準比較玄。</p><p>但其實要認識學校，最推薦的方法就是直接去問申請出國的學長姐，就可以直接了解相似背景的同學有哪些考量 (研究領域、名聲、就業、地點、花費…)、最後申請哪些學校學程 (例如生機系 Robotics 方向多去 <a href="https://ioh.tw/articles/ioharticles-%E6%B5%B7%E5%A4%96%E5%B0%88%E5%8D%80-%E4%BB%BF%E7%94%9F%E7%BE%A9%E8%82%A2-%E6%A9%9F%E5%99%A8%E4%BA%BA%E7%A0%94%E7%A9%B6%E6%89%80">CMU MRSD</a>、UIUC MEng in Autonomy &amp; Robotics；ML 方向多去 <a href="https://yachen0410.medium.com/2021-fall-%E7%BE%8E%E5%9C%8B%E9%9B%BB%E6%A9%9F%E8%B3%87%E5%B7%A5%E7%A2%A9%E5%A3%AB-%E7%94%B3%E8%AB%8B%E7%B6%93%E9%A9%97%E5%88%86%E4%BA%AB-88cddb92b0e9">UCSD MS ECE -MLDS</a>；生物方向有聽過 CMU MSCB)。</p><p>有鑑於網路上大多是資工/電機本科生的資料，以下整理生機系的選校地圖，應該也適用於其他理工非電資背景申請者 (機械、醫工、土木、…)：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Z8sDIXM8MOX6N6PuJURow.png" /><figcaption>生機系選校地圖 (紅色表示學長姐常去)</figcaption></figure><h4><strong>▌</strong>校系介紹</h4><h4><strong>Stanford</strong></h4><ul><li>不敢和大家搶 MSCS 所以我選擇申請 MSEE。因為修課很自由，所以還是可以學到想學的東西。不過準備文件的時候才發現我對 EE 的研究領域根本沒興趣，申請表還要指定有興趣的教授 … 所以文件寫得很痛苦。母親和一位推薦人還是校友，效果未知。</li></ul><h4><strong>UC Berkeley</strong></h4><ul><li><strong>MEng EECS (Master of Engineering in EECS)：</strong>台灣人只能申請這個，短短 9 個月、求職壓力大、同儕間找工氛圍濃厚。網路上歸納為適合已經有實習經歷、準備好拼命找工的同學。</li><li>因為是公立學費很便宜，而且高機率拿到獎學金。</li><li>父親是校友，前年還有去校園逛逛，可以感受到學生族群 diverse、vibrant 的文化，還有看到校園裡的機器人 <a href="https://news.berkeley.edu/2018/05/31/those-four-wheeled-robots-on-campus-explained/">Kiwi</a>。對了我爹還是 MIT 校友，看到這裡你可能會好奇，父母是校友會不會有助於申請？可參考以下章節：<a href="#15bb">Legacy Admissions 現況</a>。</li></ul><h4><strong>CMU</strong></h4><ul><li>除了正統 MSCS 有很多有意思的科系，尤其大名鼎鼎的 <strong>SCS (School of Computer Science)</strong> 底下科系就業都非常不錯 (根據<a href="https://www.cmu.edu/career/outcomes/post-grad-dashboard.html">就業報告</a>)。</li><li>CMU 很看專業經歷的相關性、GPA 倒還好 (~3.7/4.3 就夠用)。因此若對某子領域有興趣/個人經歷 cluster 於該子領域，個人認為都是有機會的！</li><li><strong>MSCV (MS in Computer Vision)：</strong>16 個月就業型學程，畢業後多去自駕車公司或大廠當 MLE/SDE、有 capstone、不利轉博。</li><li><strong>MCDS (Master of Computational Data Science)：</strong>和他校流落街頭的 DS 完全不能相提並論，可以去大廠做 SDE。不過托福要求很高 (單科 ≥ 25)。</li><li><strong>MRSD (MS in Robotics Systems Development)：</strong>Robotics 領域的夢想志願，課表很死，但就業不錯。若想轉博是申請 MSR (Master of Science in Robotics) 不是選這個。</li><li><strong>MSAIE (MS in Artificial Intelligence Engineering)：</strong>近幾年才默默出現的 AI+X 科系，轉領域友好。我選的 AI+ECE 可以在 AI 之外學到訊號處理、嵌入式系統的東西。不過 ECE 是算在工程學院不算 CS 學院。</li><li>對 CMU 的印象就是課業重但就業好，要在這樣的環境下學習需要強大的抗壓能力；另一個錄取後我才注意到的點是高昂的學費 (不過生活費比加州便宜很多)，以及似乎偏好錄取台灣學生和生理女性。</li></ul><h4><strong>Cornell Tech</strong></h4><ul><li>Cornell MEng CS 和 Cornell Tech MEng CS 不一樣。</li><li>Cornell Tech 是 Cornell 在紐約的校區，比本校區更強調 Leadership、創新，如果你是有想法、喜歡跨領域交流的人，這裡會非常適合你。</li><li><strong>Cornell Tech MEng CS：</strong>只有兩學期、課程對找工作幫助不大，但課程設置新、感覺很好玩，所以我是投這個。實際申請時感覺到他們特別在乎 (1)先修課和先修課成績 (2)未來目標 (3)申請動機。</li><li><strong>Cornell Tech MEng CM (Connective Media)：</strong>也是一個好選擇，<a href="https://medium.com/kchsu/%E5%9C%A8-cornell-tech-%E5%B0%B1%E8%AE%80-%E6%89%BE%E5%AF%A6%E7%BF%92-%E7%94%9F%E6%B4%BB%E6%98%AF%E6%80%8E%E6%A8%A3%E7%9A%84%E9%AB%94%E9%A9%97-1-93ecac3f17a1">CS 的課 CM 都能修</a>，轉領域友好，而且可以待兩年。</li><li>申請時有一個 Video Essay，估計一堆人看到這個都不敢申請了。但其實沒那麼可怕，<a href="#2a34">下面</a>我有分享到。</li><li>最後沒錄取，似乎 <a href="https://www.cs.cornell.edu/masters/apply/prerequisites">Prerequisites</a> 沒湊齊是致命傷。我都要投了才看到<a href="https://www.1point3acres.com/bbs/thread-953015-1-1.html">大部分是 CS 本科選手、CS 二碩</a>這個資訊，所以非本科不太建議申請。</li></ul><h4><strong>UCSD</strong></h4><ul><li><strong>MSCSE (MS in Computer Science &amp; Engineering)：</strong>下面還有分 CS75 (Computer Science) 和 CS76 (Computer Engineering)，可以依據自己的背景決定要投哪個，<a href="https://www.1point3acres.com/bbs/thread-873016-1-1.html">進去後似乎也可以轉</a>。</li><li>非 CS 本科系可以參考<a href="https://cse.ucsd.edu/graduate/graduate-admissions-faq#bachelor">推薦的先修課</a>，<a href="https://www.1point3acres.com/bbs/thread-924702-1-1.html">似乎也收不少非本科學生</a>。</li><li>申請表會問有興趣的子領域和教授研究，我是選 Visual Computing (Computer Graphics and Computer Vision)，他們和 Berkeley 一樣比較厲害的是 Computer Graphics (NeRF 誕生地)。</li><li><strong>MSECE (MS in Electrical &amp; Computer Engineering)：</strong>下面還有分<a href="https://instant.1point3acres.cn/thread/951315">選課自由門檻也高</a>的 EC79 (Computer Engineering)、近年來橫空出世的 EC93 (MLDS)、EC80 (Robotics相關) 等等，可以依照自己的興趣去選。</li><li>ECE 對非 CS 理工科系 (電機、機械、生機) 作為 SDE 跳板還是挺友善的，不過選課限制、人數多、<a href="https://instant.1point3acres.cn/thread/981628">上岸率</a>可能是需要多考慮的點。</li><li>CSE、ECE 申請表裡面的 Additional Experiences (類似 PS 的問題) 是完全一樣的，而且 CSE 近年來門檻很高，所以可以和我一樣兩個一起投。</li></ul><h4><strong>UCLA</strong></h4><ul><li><strong>MSCS：</strong>收的人較少，研究比較接近 DS、ML、Bioinformatics。現在有幾個台灣教授，<a href="https://shangrex.medium.com/2023-fall-mscs-mcs-%E7%94%B3%E8%AB%8B%E5%BF%83%E5%BE%97-1ba53dbe96c4">如果有 Connection/研究領域有 Match 可以投</a>，轉博友好。</li><li><strong>MEng (Master of Engineering)：</strong>有很多個 Track，包括 DS、AI 等領域，不過據說<a href="https://www.1point3acres.com/bbs/thread-1038898-1-1.html">課程和學校資源對找工作沒啥幫助</a>。氣候宜人、課程輕鬆所以對於在乎留學體驗的同學蠻推薦的。<a href="https://www.sohu.com/a/572399255_100166915">因為是 2021 才蹦出來的 Program 未來門檻應該會變高</a>。</li></ul><h3>✦ 申請資料準備✦</h3><h4>▌成績單</h4><p>我申請的學校全都是要 Unofficial Transcript，台大的話網路上按一按就可以拿到。GPA 4.3 制通常不用轉成 4.0 制，然後未畢業成績單上沒有 Overall GPA 所以需要在學校的系統上找 (推甄名次)。</p><p>選校時可以留意 Program 對於成績的偏好，例如自己 GPA 不高的話可能就要少選在乎成績的學校；部分例如 CMU 多個科系比較重視實務經驗，他們 GPA 的門檻就不高。</p><blockquote><em>小技巧：申請時如果是在學身份，可以在該學期多選課，加退選結束後申請成績單，之後再把不要的課停修掉。這樣學校那邊收到的就會是你正在修這門課，不知道後來停修掉了。</em></blockquote><h4>▌GRE/TOEFL</h4><p>有需要可以參考下面這篇。原以為很輕鬆但我最後 GRE 讀 5 個月、TOEFL 4 個月，都考第二次才有理想的分數，所以也建議預留多一點時間比較好。</p><p><a href="https://medium.com/@berlinnn3388/2024-fall-gre-toefl%E5%82%99%E8%80%83%E5%BF%83%E5%BE%97%E5%88%86%E4%BA%AB-599651bb5b0f">[美國留學] GRE/TOEFL 準備</a></p><p>GRE 如果 V+Q ≥ 320 且 Q = 170 就建議放，即使 GRE 不是 required；TOEFL 比較重要，盡量可以考到 100，但實際上大部分工程學院 90 就可以了。</p><blockquote><strong><em>後記：</em></strong><em>回頭看 8 間需要 GRE 的只有 2 間 (CMU MSCV、UCSD MSECE)，可見大部分都不用 GRE。所以確定好學校完全不需要 GRE 可以索性不考，可以省下時間做更重要的事情。</em></blockquote><h4>▌CV</h4><p>要注意申請國外學校的 CV 和求職的 Resume 差很多。以下分享幾個寫 CV 時有用的點 (適用於理工科系) (PhD 不適用)：</p><ul><li><strong>Contact Info:</strong> 除了最基本的 (1) 信箱 (2) 電話，建議放 <strong>(3) LinkedIn (4) 個人網站 </strong>，要放 (5) Github (6) Medium 之類的也可以。</li><li><strong>Education:</strong> 非本科系可以選擇性列好看的 “Overall GPA”、“Last-60 GPA”、“CS-Related GPA”，然後下面列出 “Relevant Coursework: …”。</li><li><strong>Work / Research / Teaching / Project Experience: <br>- </strong>可以把最重要的欄位排在前面，欄位內的經歷要照時間順序排。<br>- 只要是有拿錢的就可以算是 Work Experience：RA、研究有拿 Fellowship、TA 有拿薪資也可以考慮納入 Work Experience。<br>- Jargon 要根據目標領域客製化，例如 CS 用詞 AI / Computer Vision 在申請 EE 領域可以改成 Machine Learning / Image Processing。<br>- 每項開頭的 <a href="https://hls.harvard.edu/bernard-koteen-office-of-public-interest-advising/opia-job-search-toolkit/action-verbs/">Action Verb</a> 要慎選！<br>- 盡量讓每一行寫到滿，若目前一行半可以考慮縮到一行或佔滿兩行。</li><li><strong>Publications / Skills / Awards:</strong> 確保格式正確且一致就沒問題。</li><li><strong>Extracurricular Activities:<br>- </strong>如果想強調領導能力可以寫成 “Leadership”。<br>- 好用的 <a href="https://hls.harvard.edu/bernard-koteen-office-of-public-interest-advising/opia-job-search-toolkit/action-verbs/">Action Verb</a>: Facilitated、Delivered、Organized、Led。<br>- 盡可能量化團隊人數、活動規模、影響人數、$$ (轉成 USD)、KPI (%)。</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTJBKV0djbpZGhfauMvvJQ.png" /><figcaption>當時申請學校的 CV</figcaption></figure><h4>▌Statement of Purpose (SOP)</h4><p>想分享的 SOP 撰寫技巧都寫在下面這篇，大致上涵蓋過去經歷、學術興趣、未來目標、Program Fit 等等內容，說服目標學校自己是最佳人選。</p><p><a href="https://medium.com/@berlinnn3388/2024-fall-%E8%B6%85%E8%A9%B3%E7%B4%B0%E7%95%99%E5%AD%B8%E6%96%87%E4%BB%B6%E6%BA%96%E5%82%99-sop-79c6042abd49">留學申請文件：Statement of Purpose</a></p><p>SOP 很重要，也不好寫，建議多預留一點時間來準備這個文件。</p><h4>▌PS/PHS/Additional Essay</h4><p>我想分享的寫作方法都整理在以下連結。這些文件可以呈現個人的成長背景、理念並以事蹟佐證，以及這些如何讓目標學校更好。</p><p><a href="https://medium.com/@berlinnn3388/2024-fall-%E8%B6%85%E8%A9%B3%E7%B4%B0%E7%95%99%E5%AD%B8%E6%96%87%E4%BB%B6%E6%BA%96%E5%82%99-2-ps-additional-essays-9218ef25b7dc">留學申請文件：PS/PHS/Additional Essays</a></p><p>每一個題目、學校理念、科系特色都天差地遠，所以都要高度客製化。雖然都還是要認真寫，但某些理工科系似乎也不太看，因此不用太有壓力。</p><h4>▌推薦信</h4><p>美國的學校一般都會需要三位推薦人。要找到三個其實不容易，所以最好在大三左右就要有計劃，也要想盡辦法在推薦人面前努力表現。</p><p>有些學校會規定至少兩位是大學教授，所以可以規劃 <strong>3 * 教授</strong> or <strong>2 * 教授 + 1 * 實習主管</strong>。蠻建議去實習累積經驗順便拿推薦信，像我當時找了暑期實習，這樣就有業界主管可以呈現職場上的能力。</p><p>最後的推薦人名單：<strong>(1) 指導教授：</strong>計程/影像處理課程表現、專題研究成果、主動協助實驗室新生 <strong>(2) 系主任：</strong>電子學/資結/AI概論課程表現、資結/AI概論 TA、樂於助人特質 <strong>(3) 實習主管：</strong>專業能力、提出創新方法、快速學習與適應能力。</p><p>我的流程：(1) 準備初稿以免他們沒時間寫/沒用心寫 (2) 口頭邀請後寄給他們相關資料 (成績單/CV/SOP初稿)、註明截止日期 (3) 若接近截止但還沒上傳，用 Discord/Messenger 提醒推薦人。</p><p>其實絕大多數在申請表送出之後還是可以陸續上傳推薦信，晚個幾天也沒問題。所以不用太急著催推薦人，我覺得截止前一天還是沒交再提醒就行。</p><h4>▌Video Essay</h4><p>在申請 Cornell Tech 的時候有遇到 Video Essay，就是給你 15 分鐘準備 3 個問題，然後錄一個 5 分鐘的回答。但其實沒有想像中可怕，因為網路上都會有大陸人的 “面經”，先準備好講稿，題目來了變通一下就可以。附上我熱騰騰的 Video Essay 考題 (2025)：</p><blockquote><strong>Question 1: </strong>Please list one example for each: What is something unique about Cornell Tech and your specific program that you will not be able to get at another school to which you’re applying?</blockquote><blockquote><strong>Question 2:</strong> Thinking about the last time you had to work on a team, what did you find enjoyable? Also, can you tell us about a challenge your team faced while working together and the outcome?</blockquote><blockquote><strong>Question 3: </strong>What are your professional plans upon completing your Cornell Tech degree? (please be as specific as possible — e.g., if you’re planning on starting a company or joining an existing one, please describe your aspirations. In addition, can you describe how your goals align with Cornell Tech’s mission and values?</blockquote><h4>▌(Optional) 個人網站/LinkedIn/GitHub</h4><p>有些學校申請表上會特地有一欄可以放 URL，個人網站可以清楚展示自己的作品。有時間有興趣可以參考前陣子無聊寫的個人網頁小教學：</p><p><a href="https://medium.com/@berlinnn3388/%E8%A3%BD%E4%BD%9C%E4%B9%BE%E6%B7%A8%E7%B0%A1%E5%96%AE%E7%9A%84%E5%80%8B%E4%BA%BA%E7%B6%B2%E9%A0%81-%E4%BD%BF%E7%94%A8-jekyll-github-pages-911ffb7d2edc">教學 | 新手友善 | 最簡單打造個人網頁</a></p><p>LinkedIn 主頁、GitHub 也建議可以整理一下，看看學長姐怎麼整理的，然後找一個順眼的來模仿就可以，但這些比較不急，送出申請資料後再慢慢更新也可以。</p><h3>✦ 準備時程和花費✦</h3><h4>▌最後一年時程規劃</h4><p>和大家一樣，到最後都會課業、英文考試、研究、實習擠在一起，超忙超累。實際觀察要出國的同學都展現了一定程度的決心和韌性。</p><ul><li><strong>大四下：</strong>修涼課、讀 GRE、衝研究進度。</li><li><strong>大四-大五暑假：</strong>實習 (補足工作經驗、推薦信)。</li><li><strong>大五上：</strong>修研究所課、讀托福、當 RA、TA、準備申請資料。</li><li><strong>畢業後：</strong>等 Offer、當兵、入學手續、準備出國。</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NjAg0HlJrdIoqpqZxAv-Rg.png" /><figcaption>目標 2025 Fall 入學時程規劃</figcaption></figure><blockquote><em>當時選擇延畢半年的原因：(1) 有學籍才能找暑期實習 (2) 延畢修的 CS 相關課可以呈現在成績單上 (3) 多修一堂課湊滿人工智慧領域專長 (4) 擔心申請季同時要處理兵役事項。</em></blockquote><h4>▌留學申請花費</h4><p>我的申請階段總花費：<strong>249,343 NTD</strong>。</p><p>其實一般不用花到這麼多，會比較多是因為：(1) 1x 萬的留學顧問 (2) 各考兩次的 G/T 及它們的補習班 (3) 後來發現其實不用的 WES 成績認證。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQhaE6AdVnrGF4haVqbXVg.png" /><figcaption>申請總花費</figcaption></figure><p>不找代辦、英文考試順利的話，大概 80,000–100,000 就可以搞定研究所申請。英文考試很貴 (超過 7,000)，一定要善用不時會有的 GRE/TOEFL 考試七折券、GRE/TOEFL 成績單寄送買三送一券。</p><p>關於錢錢還是要跟家人建立良好的溝通方式，畢竟出國留學後還是會常常需要討錢。我的方式是用一個 Google 試算表來記錄申請支出和收據，家人可以隨時點開來看，同時也會口頭更新現在刷了多少錢、之後預計還要多少。</p><h3>✦ 其他補充✦</h3><h4>▌我現在才大二/大三，我可以如何準備？</h4><p>這部分我覺得超重要，但在網路上很少有人分享。以下建議都是從我的個人經驗出發，適用於理工科系申請者：</p><ol><li><strong>好好選課：<br></strong>- 放下「修很多課→充實的大學生活」的思維，選課時認真取捨。<br>- 除了確保 <strong>GPA</strong>，「英文課名和目標科系的相關性」也重要。<br>- 若已加入實驗室，可以請教學長姐，修對專題有幫助的課。<br>- (超重要)不要跟風！倒是可以帶風向叫同學跟你修同一堂課。<br>- 確保課業不會太重，有時間參與課外活動。</li><li><strong>加入實驗室：<br></strong>- Lab 做的事情會決定性影響未來發展的領域。<br>- (超重要)不要跟風！倒是可以帶風向叫同學跟你去同一個 Lab。<br>- 盡可能把握任何 <strong>研討會發表/RA/TA</strong> 的機會甚至寫期刊。<br>- 多請教實驗室預計出國的學長姐。</li><li><strong>充實課外經歷：<br></strong>- 對申請有大幫助的包括 <strong>(1) 專業相關 (2) 領導經驗 (3) 合作經驗 (4) 展現英語能力經驗 (5) 促進 EDIB 經驗。</strong><br>- (1) 課外專題、競賽、黑客松都可以 (推薦：Google HPS)。<br>- (2) (3) 系上活動、校級活動、社團等等都可以累積。<br>- 若有 (4) (5) 的話 PS/PHS/Additional Essay 會比較突出 (推薦：NTU OIA 各式各樣活動，幫助國際學生適應環境)。</li><li><strong>加強英文實力：<br></strong>- 有時間可以提早準備 GRE (有效 5 年)、TOEFL (有效 2 年)，沒信心可以報補習班試試水溫。<br>- 英文寫作會從進實驗室開始的論文寫作、英文考試、申請文件準備一路糾纏，尤其最後的申請文件不是 AI Tool 改一改就可以寫好的，早點增強英文寫作能力會很吃香。<br>- 台大的同學可以修 “深造預備英文寫作” (每學期都會開)，可以快速了解留學申請文件和它們的寫法 (大四最理想，建議不要太早修)。</li></ol><h4>▌是否推薦留學代辦/Editor</h4><p>當時親友經營留學顧問公司所以我有請代辦幫忙，以下分享我的觀察：</p><ol><li>代辦可以完成各式各樣的行政作業 (有的甚至包括後續入學、簽證、宿舍申請)、協助你完成申請資料 (CV、SOP、PS 等等)、確保符合學校規定、提供情緒價值 (陪伴、給予自信、安心感)。</li><li>但是很花錢，尤其美國、理工科系、Top 30 更貴，想多申請學校還要加錢。加一加通常要 12–15 萬，服務比較少的可能也要 8–10 萬。</li><li>他們在行的其實只有看懂學校規定、處理行政事項，申請資料也是轉交外師編修。他們沒有專業相關的背景、也沒有理解目標科系的特色，而外師只有能力精修文字，所以各種 Essay 內容上還是要自己對自己負責。</li><li>實際體驗下來，我認為建議找代辦的族群包括 (1) 英文不好以致於看不懂學校需求 (2) 家長想確保小孩成功申請 (3) 真的真的很忙 (4) 直接放推 (全給代辦寫應該還是可以寫出 65–70 分的文件)。</li></ol><p>如果沒有找代辦，我<strong>建議要找 Editor</strong>，要注意的地方：</p><ol><li>比較有名的編修老師要早點預訂不然可能找不到。</li><li>自己撰寫初稿可以更專注於架構、內容的安排，也不需要 AI 協助，反正Editor 會改善用詞、流暢性、語氣等小地方。</li><li>每個學校、每個文件要計算收費和來來回回，溝通成本比代辦高。</li></ol><p>現在的 Editor 應該都對 AI 生成文字的警覺性很高，會特意把 AI 過於 Formal、Generic、Low-density 的表達改成 Natural、Sincere、Concise 的樣子。所以強烈不建議只自己和 AI 反覆修，母語人士一看就能看出來。</p><h4>▌Legacy Admissions 現況 (2025)</h4><p>Legacy Admissions 指得是家庭成員中有人為該校校友，則較容易錄取該學校的狀況。筆者找資料的過程中，發現過去因為 (1) 校友較有機率捐錢 (2) Legacy 後代入學後表現更好 (3) 延續學校影響力 而有此措施，但由於會影響無背景學生錄取率和輿論影響，現在大多學校 Legacy 制度都被取消了。</p><p>以 Stanford 為例，最近因為加州法案公開 Legacy 數據，根據 <a href="https://www.myivylink.com/blog/californias-bold-move-legacy-admissions-out-merit-based-applications-inwhat-families-should-do-next">2022 入學數據</a>、<a href="https://www.koppelmangroup.com/blog/2022/7/15/stanford-legacy-guide">2023–2025 數據 (2019–2021入學)</a>，大學部錄取率大概是 Legacy <strong>14%</strong> 和 Non-legacy <strong>4%</strong> 的區別 (但在申請研究所的優勢小很多)。</p><p>UC 早已沒有 Legacy 制度、MIT <a href="https://mitadmissions.org/help/faq/legacy/">官方寫沒有 Legacy</a>，而最近<a href="https://www.gov.ca.gov/2024/09/30/california-bans-legacy-and-donor-preferences-in-admissions-at-private-nonprofit-universities/">加州法案</a>宣布 2025 年 9 起 Stanford、USC、Santa Clara 等校也沒有這個制度。</p><h4>▌跨領域申請心得</h4><p>身為非本科系但又不是完全沒重疊的申請者 (生機系橫跨：EE、CS、ME、Bioengineering)，我在實際申請過後的一些心得：</p><ol><li><strong>能修到的相關課當然沒有 EE/CS 本科生多，畢竟還要顧好自己科系的學分：</strong>有的人選擇在大三大四把別人的基礎課補齊，但我是選擇果斷不讀，對我而言花時間在累積研究、實習經歷比較有趣也比較有用。</li><li><strong>跨領域背景寫 SOP、PS 其實很容易寫出 Diversity 也更有意義<br></strong><em>e.g. 我的專題應用 CV + IoT 為畜牧業建立乳牛監測系統，促進牧場管理效率和動物福祉，其中就可以寫到跨領域合作、理解異領域需求、對社會有幫助的科技、互相信任這種。</em></li><li><strong>跨領域申請者不是少數：</strong>尤其在就業好的科系，因為大家都想跨進來，所以跨領域申請其實是多數。不得不說我認識每個非本科申請 CS 的同學都是非常之人，倒是本科生容易不小心活在同溫層而缺乏亮點。</li><li><strong>美國的學校都重視/聲稱重視 Interdisciplinary Collaboration：</strong>使得跨領域申請至少比在亞洲友善太多。就算沒有實際的跨領域經驗，非本科系的背景在 SOP、PS 有時可以很好連結學校特色、加強 Program Fit。<br><em>e.g. UCSD 最強的領域是 Biomedical Engineering，因此把我生物工程的背景放進來就可以說我預計要 “engage in conversations across disciplines and explore collaboration opportunities beyond CSE/ECE”。<br>e.g. Berkeley 的 MEng EECS 會和工程學院其他系學生 (ME, BioE, IEOR)</em> <em>混在一起，這時候跨領域背景又可以拿出來講。</em></li></ol><p>綜合以上觀察，除了基礎課必定落後本科系學生，只要<strong>努力累積目標科系相關經歷 (最好是結合原本領域和目標科系)</strong>，一定能生出一個獨特且具說服力的申請資料！</p><h4>▌我踩過的坑</h4><p>以下精選我踩過的坑，希望可以幫學弟妹避避雷：</p><ol><li><strong>WES 成績認證：</strong>當初看別人心得文有做 WES，所以代辦提醒我要做這個成績認證的時候，我想也沒想直接就付款了。後來才發現大部分學校只要上傳台大的 unofficial 成績單就可以，只有 Cornell Tech 是錄取後才要。反正就是成績認證費、寄送費 (9,000多) 白給了。</li><li><strong>代辦多一間多 6000：</strong>這讓我最後只敢申請 8 間。但實際上因為 CS 錄取標準很玄，很多人會申請到 10–15 個當作抽抽樂，但我沒辦法。</li><li><strong>低估申請資料準備：</strong>大五上塞太多研究所課和相關經歷，導致留給申請文件的時間不多 (當時應該要學會放下課業，反正也看不到新學期成績)。</li><li><strong>不敢找人幫忙：</strong>其實我一直都知道每個人都可以提供不一樣的想法，申請期間也有學長/朋友的朋友/家人的朋友主動提供支援，但直到最後一刻我還是無法鼓起勇氣請別人幫忙看。</li><li><strong>教授沒收到推薦信通知：</strong>當時有兩個信沒有成功到教授的信箱，截止前一天問教授才知道系統沒成功通知，還好有發現。</li></ol><h4>▌關於壓力和心態調適</h4><p>申請準備階段時常感到壓力是正常的。從大三開始，我看了很多像是這篇的申請經驗分享，導致我當時一直想趕快累積經歷、證明自己。長期這樣焦慮也導致我身心出狀況、依賴抗憂鬱藥物，反而能專注的時間被大大壓縮。</p><p>大四終於獲得了一些機會讓心裡踏實一點，例如當 TA、RA、出國參加研討會等等，但這時身體更虛弱也難專注，使得我讀 GRE 的過程非常艱辛；大五也接了很多工作，同時要趕申請資料，非常折磨！</p><p>親身經歷兩年半連續轟炸，我學到了「有時放輕鬆，結果不會很糟」的道理。例如期中期末考，我以往會無止盡準備以確保 A+，但在大五不重視課業後，發現其實 60% 的準備最後分數也差不多？！(而且拿 A+ 的心情加倍開心)；又例如 CV 上的經歷，其實大部分也看不出用功程度，像是 TA 經歷也很難表達出那些忙著回覆學生、搞定伺服器的災難夜晚，所以當初其實不用那麼戰戰兢兢？！</p><h4>▌送出申請了，然後呢？</h4><p>到了這個階段，大家都放下活到現在最大的一顆石頭。沒什麼事不妨給自己一個大假期，如果休息夠了，可以開始慢慢看求職資訊、調查學長姐的去向、想想未來的目標，最簡單直接的方式是多問問認識的學長姐。</p><p>很多四個月役男和我一樣在申請過後當兵 (我是 3/18 入伍)，不過最理想的規劃是<strong> 1–2 月就入伍、 5–6 月退伍密集準備美國入學事項</strong>。</p><p>對了，我也是等 Offer 的時候才知道，可以在 <a href="https://offerland.cc/results">OfferLand</a> 上面看別人的錄取結果和日期、回報自己的狀況，上面的都是台灣人。大陸人的 <a href="https://offer.1point3acres.com/results">Offer多多</a> 、老外的 <a href="https://www.thegradcafe.com/survey/">GradCafe</a> 也可以看到即時的匯報。</p><h3>結語</h3><p><strong>寫這篇航空母艦總整理還是挺累的，但是如果能把自身經驗給預計出國的學弟妹參考還是很值得！</strong>每個人的時空背景和體驗不盡相同，因此吸收到對自己有用部分就可以，也建議多看看網路上其他同學的分享。最後，我也很願意分享我當時的申請文件給大家參考，大家可以用 <a href="https://www.linkedin.com/in/polin-chen/">LinkedIn</a> 或寄信來跟我要，留學申請相關的問題也歡迎來問我。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cu5zFg65LYilZnagrcbBaA.png" /><figcaption>最後決定去 CMU！祝大家都可以去自己想去的學校！！</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f85e543f40a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[美國留學 | 申請文件 | PS/PHS/Additional Essays]]></title>
            <link>https://medium.com/@berlinnn3388/2024-fall-%E8%B6%85%E8%A9%B3%E7%B4%B0%E7%95%99%E5%AD%B8%E6%96%87%E4%BB%B6%E6%BA%96%E5%82%99-2-ps-additional-essays-9218ef25b7dc?source=rss-2ce077012a76------2</link>
            <guid isPermaLink="false">https://medium.com/p/9218ef25b7dc</guid>
            <dc:creator><![CDATA[Po-Lin (Berlin) Chen]]></dc:creator>
            <pubDate>Sun, 29 Dec 2024 13:16:49 GMT</pubDate>
            <atom:updated>2025-07-27T18:28:25.463Z</atom:updated>
            <content:encoded><![CDATA[<h3>前言</h3><p>這篇想要分享除了 SOP (Statement of Purpose) 以外的申請文件： PS (Personal Statement)、PHS (Personal History Statement)、Additional Information、Additional Essays 等等。</p><h3>目錄</h3><ul><li><a href="#a3cf"><strong>PS/PHS/Additional Essays 概論</strong></a><br>- 不同的稱呼<br>- 透過 Essay 傳達的訊息<br>- 一些好用常用的詞</li><li><a href="#27f7"><strong>寫作方法分享</strong></a><strong><br>- </strong>認識自己<br>- 策略性挑選內容<br>- 寫作架構<br>- 用詞和語調</li><li><a href="#6cfa"><strong>各校準備策略和心得</strong></a><strong><br></strong>- UCLA MEng — Personal Statement<br>- Stanford MS EE — “Enriching…” Essay &amp; Short Answer<br>- UCSD MS CSE/ECE — Additional Experiences<br>- CMU MS AIE-ECE — Additional Information<br>- UC Berkeley MEng EECS — PHS &amp; Opportunity Grant Essay<br>- Cornell Tech MEng CS — Personal Statement</li><li><a href="#5c5c"><strong>其他補充</strong></a><strong><br>- </strong>PS/PHS/Additional Essays 重要嗎？<br>- 我才大二/大三，我可以做什麼準備？</li></ul><h3>✦ PS/PHS/Additional Essays 概論✦</h3><h4>不同的稱呼和形式</h4><p>每個學校、各個 Program 的需求都很不一樣，但通常在 SOP 之外都有類似這樣的 Essay，我有接觸到的稱呼：</p><ol><li>PS (Personal Statement)、PHS (Personal History Statement)</li><li>申請表出現 Additional Information、Additional Experiences 這樣的欄位給你寫 (CMU、UCSD)</li><li>除了 PS 額外的 Essay: Enriching the Learning Community (Stanford) 、Opportunity Grant Essay (Berkeley)</li></ol><p>但反正內容上就是要呈現 CV、SOP 可能無法傳達的一些東西，例如個人見解、人格特質、非技術能力、特殊經驗等等，提供給招生官一個更立體的印象。</p><h4>透過 Essay 傳達的訊息</h4><p>雖然 Personal Statement 聽起來像是圍繞著自己講故事，但實際上應該根據每個學校的 Requirements 來擬定方向、舉出具體經歷、回答問題。也可以在這裡表現自己對於目標學校、科系特色、領域的理解並偷渡 Program Fit 的概念。</p><p>身為學生的我們經常會害怕自己和別人不一樣，但是招生委員一次看這麼多文件 (而且都是領域相同、背景相近的申請者)，我認為寫得越特別才能抓住注意力。尤其亞洲理工學生大多寫得中規中矩、正式口吻，這時新穎的個人理念、打破規則的寫法很容易可以脫穎而出。</p><p>不過也不是只要會畫大餅就可以寫得很 Strong，因為他們也會找尋具體的事蹟來佐證文章提到的個人理念，所以平時有累積相關的經驗還是很重要的。</p><h4>一些好用常用的詞</h4><ul><li>Diversity, Unique Perspective, Equity, Inclusion, Respect</li><li>Interdisciplinary Collaboration/Communication/Discussions</li><li>Innovation (實際應用價值), Creativity (新奇想法)</li><li>Integrity, Ethics, Being Trustworthy, Genuine (工程師特質)</li><li>Leadership, Knowledge-sharing (影響他人)</li></ul><h3>✦ <strong>寫作方法分享</strong>✦</h3><h4>認識自己</h4><p>了解自己很重要！如果平常不常去了解自己，可以仔細回顧一下 (1) 過去經歷 (2) 這些經歷的共通點 (3) 為什麼當時會這樣選擇 (4) 想成為怎麼樣的人 (5) 別人覺得自己是怎麼樣的人。很多時候會發現以前在做決定時沒想這麼多，事後看起來這些經歷竟然連成一條線。</p><p><em>e.g. 我有很多跨領域合作經驗，後來發現自己其實不喜歡團隊合作，而是喜歡當貢獻獨特專業的角色，因此也不喜歡處在無聊的工程師團隊。</em></p><p><em>e.g. 我在別人眼中經常是可靠、穩定的存在，那或許我其實在乎 Being reliable, trustworthy, and genuine，或是我太在乎別人對我的想法。</em></p><p>除了過去主動爭取的經歷，Diversity 也有很多東西可以寫，就算你跟我一樣只是一個最沒人要的亞洲理工非低收非偏鄉直男。這種思考是非常需要練習的，以下列舉幾個方向：</p><p><em>e.g. 台灣身份至少比中國學生特別一點，可以思考台灣獨特的歷史發展/產業結構/傳統價值/教育環境有沒有帶給自己什麼？</em></p><p><em>e.g. 女性/LGBTQ+ 可以舉出曾因性別/性向遭受不平等待遇的經驗，以及受到啟發後做了什麼實際行動？(美國的學校不少性別有關的學生組織)</em></p><p><em>e.g. 成長的環境有沒有特別的地方？父母的職業有沒有造成什麼啟發？</em></p><h4>策略性挑選內容</h4><p>一定要做足功課才能決定要放哪些內容，推薦可以從以下幾個方向開始：</p><ol><li><strong>Requirement：</strong>規定必須提到哪方面的內容？哪些是重點？字數限制？ (大部分 500 字或一頁)</li><li><strong>Guideline：</strong>除了上面的，很多學校會有全校/該學院的 General Guidelines (e.g. <a href="https://grad.berkeley.edu/admissions/steps-to-apply/requirements/personal-statement/?source=post_page-----8ca9142642ad--------------------------------">UCB’s Writing the Personal Statement</a>)，可以用來了解該學校整體期望的申請者屬性，和上面的 <strong>1.</strong> 比較可以猜測該 Program 更加重視什麼？為什麼這個重要？</li><li><strong>學校/學院/科系官網：</strong>幫助理解核心理念和強項 (e.g. <a href="https://ucsd.edu/about/principles.html">UCSD’s Principles of Community</a>) 以及偏好怎麼樣的學生。另外 EDIB (Equity, Diversity, Inclusion, Belonging) 相關的資訊也可以多看看，像是可以寫說自己預計加入什麼組織持續貢獻 (e.g. <a href="https://ee.stanford.edu/diversity">Stanford’s CEI Committee</a>)。</li><li><strong>一畝三分地/Medium/Dcard/PTT：</strong>可以看看別人的實際入學體驗。</li><li><strong>系所課程：</strong>有些會有領導相關的課、需要合作的 Capstone、特色課程 (e.g. <a href="https://tech.cornell.edu/studio/curriculum/">Cornell Tech’s Studio</a>)，可以考慮提到然後強調契合度。</li></ol><p>把自己的背景和經驗列出來對應 Requirement，有些應該就很明顯是可以放進內容的。這時也很推薦從 Requirement 反推回去硬連每個經驗，常常會發現某些其實也可以寫進去。</p><p><em>e.g. 假如主軸是 “Tech for underrepresented populations”，就去想想做過的哪些 Projects 其實是可以幫助弱勢族群的，或許發現其實很多。</em></p><h4>寫作架構</h4><p>我是比較中規中矩的寫法，照著時間順序寫經歷。以下是一篇我寫過的 500 字 Personal History Statement：(Div: Diversity, Exp: 過去經驗)</p><ul><li><strong>開頭：(Div. 1) </strong>TW 從農業發展到科技重鎮，農業被遺落 → 想為像農業的被忽視產業帶來科技發展 → 讀 <strong>(Div. 2) </strong>Biomechatronics Engineering。</li><li><strong>幫助被忽視產業：(Exp. 1)</strong> 開發乳牛監測系統，為畜牧業帶來更好的工作效率、保障動物福祉。</li><li><strong>促進教育資源的平等：</strong> <strong>(Exp. 2)</strong> 帶領開發具教育意義的智慧回收裝置給偏鄉小學 <strong>(Exp. 3) </strong>總籌寒假營隊為偏鄉國小提供音樂教育資源。</li><li><strong>協助高等教育的稀少族群：(Exp. 4) </strong>為台大新來的外籍學生提供校園導覽 <strong>(Exp. 5) </strong>個別協助外籍學生註冊、選課事宜。</li><li><strong>在學期間的計劃：(Div. 3) </strong>用我的跨領域背景和經驗促進多元的對話、預計加入 ANova、PiE 等學生組織來持續貢獻。</li><li><strong>畫大餅結尾：</strong>“These examples of my commitment to serving underrepresented communities are evidence of my belief in using my abilities to help those less fortunate and giving everyone a fair shot. …”</li></ul><p>如果是在申請表上的形式 (Additional Information/Experiences)，可能有數個小題、每題通常只會給 100–300 words。我的心得是開頭和結尾可以省略，每題 1–2 個例子就差不多，留點篇幅來扣題。</p><h4>用詞和語調</h4><p>用詞上可以多 Generalize 過去經歷來盡量符合題目，常用的：</p><ul><li><strong>個人理念：</strong>EDIB (equity, diversity, inclusion, belonging), integrity, respect, trust, innovation, creativity, ethics, preserverance</li><li><strong>弱勢/少數：</strong>underrepresented, underserved, underprivileged, overlooked, neglected, marginalized</li><li><strong>能力：</strong>leadership, interdisciplinary communication, knowledge-sharing, empowering others, enriching student community</li></ul><p>建議用真誠平實一點的 Tone，因此蠻推薦找母語者或潤稿會比較像真人，只用 AI 輔助很容易落入過於 formal、generic、low-density 的陷阱。</p><h3>✦ 各校準備策略和心得✦</h3><h4>UCLA MEng — Personal Statement</h4><ul><li>最早截止的那個 (12/1)，字數 500 words (一頁左右)。</li><li>回答 1 或多個 Prompts：Diversity、Academic influences、Challenges、 Understanding barriers、Engagement in inclusive activities、Plans to contribute。</li><li>UC 看起來比較偏重 Diversity，可以參考他們的 <a href="https://regents.universityofcalifornia.edu/governance/policies/4400.html">Diversity Statement</a>。</li></ul><h4>Stanford MS EE — “Enriching…” Essay &amp; Short Answer</h4><ul><li>“Enriching the Learning Community” 是藏在申請表裡面的 500-word Essay，有點玄，主要是說 “個人過去經驗如何 shape you as a scholar，以及如何對 Stanford 做出獨特的貢獻”，接近 Diversity 方向。</li><li>這篇的內容我有往他們的 <a href="https://ourvision.stanford.edu/?utm_source=chatgpt.com">Vision</a> 和 <a href="https://uco.stanford.edu/stanford-values?utm_source=chatgpt.com">Values</a> 去寫，有提到預計加入 <a href="https://ee.stanford.edu/about/student-life-culture-equity-and-inclusion-ee">Culture, Equity, and Inclusion Committee</a>。</li><li>申請表裡面的 Short Answer 要討論 “一個你曾經突破困難且導致成功的例子”，1000 characters (約 150 words)。為了對應到學校想培養未來領導人和創業家，我是講一次重大的演講使我克服 public speaking 的故事。</li></ul><h4>UCSD MS CSE/ECE — Additional Experiences (optional)</h4><ul><li>兩個 Program 的申請表這欄是完全一樣的。</li><li>UCSD 重視 Diversity、Social responsibility、Technology ethics、Interdisciplinary collaboration。</li><li>七題 Optional：Leadership、Overcoming Adversity、Community Involvement、Social Justice、Personal or Professional Ethics、Research 外加一題 Other，都沒字數限制。</li><li>七題我硬是寫出了六題，Other 舉了兩個例子說我喜歡 knowledge-sharing、helping others grow，且想在 UCSD 延續這個使命。</li></ul><h4>CMU MS AIE-ECE — Additional Information</h4><ul><li>CMU 在乎 Excellence、Innovation、Diversity、Respect for others、 Integrity、Trusting、Being trustworthy。</li><li>第一題是要分享 Non-academic Information，300 words。</li><li>第二題要講預計如何貢獻，200 words。</li><li>第一題我後來是寫一個 initiate project 的經驗，開發科技為社會帶來正面影響；第二題因為篇幅很短，我選的第一個例子對應到 Excellence、Innovation、Being trustworthy，另一個對應 Diversity、Respect。</li></ul><h4>UC Berkeley MEng EECS — PHS &amp; Opportunity Grant Essay</h4><ul><li>不分科系的 PS Guideline 寫得很清楚，可以參考 <a href="https://grad.berkeley.edu/admissions/steps-to-apply/requirements/personal-statement/?source=post_page-----8ca9142642ad--------------------------------">Writing the Personal Statement</a> 和 <a href="https://grad.berkeley.edu/graduate-diversity/prospective-grad-students/preparing-your-application-for-graduate-school/#panel-2-2">Personal Statement Guide</a> 這兩篇。</li><li>Personal History Statement (PHS) 主要圍繞在理解高等教育中 Barriers、幫助 Underserved populations 的 research/service/leadership 經驗。無字數限制，感覺 500 words 差不多。</li><li>這篇對於很多人不太好寫的地方，可能是未曾遭遇或是未曾注意別人的 Barrier，而且還要盡量扣到高等教育環境。Barrier 可能是窮困的學生得不到教育資源、外籍學生有語言和文化的障礙、身障學生無法融入社會群體… 也可以想想有沒有認識的同學正遭遇 Barrier，是否帶給自己啟發。</li><li>有說預計加入 ANova、PiE 等學生組織來持續促進教育資源平等。</li><li>Opportunity Grant Essay 好像是錄取時可能會根據這篇來決定獎學金，題目是要說明自己的經濟狀況、如何貢獻 Diversity 到學生群體。</li><li>因為是獎學金性質的文章，所以我第一段就說我大學期間當 Math tutor、 TA、RA、Intern 減輕經濟負擔；中間段和 PHS 差不多但改成 Diversity 敘述方向；最後一段就說得到這個獎學金使我有時間可以在學校促進 Diversity。最後也寫差不多 500 words。</li></ul><h4>Cornell Tech MEng CS — Personal Statement</h4><ul><li>聲稱是 Personal Statement 但實際上因為沒有 SOP，其實是 SOP + PS，1100 words。</li><li>特色是要和其他領域學生跨領域合作、和 New York City 有緊密連結 (communities, companies, cities, nonprofits, hospitals)，重視 Leadership、Creativity、Innovation。</li></ul><h3>✦ 其他補充✦</h3><h4>PS/PHS/Additional Essays 重要嗎？</h4><p>根據網路說法和個人的觀察，硬要排申請資料在申請美國 Master 的重要性：<strong>GPA+校系 ≥ CV &gt; SOP &gt; PS &gt; TOEFL ≥ GRE</strong> (如果從另一個面向來看就是：成績 ≥ 專業經歷 &gt; 非專業經歷 &gt; 英語能力)。</p><p>這樣看起來好像 PS 就不太重要，但是它關鍵嗎？我覺得有時候是。以申請者最大族群 — 亞洲理組男性而言，從小根本沒有去想 PS 要寫的這種東西、不曾表達自身動機和思考、課外活動也少，最後自己寫出來的可能 65–70 分、AI 輔助和潤稿後頂多 70–75 分；如果平常就有在思考這類問題、對自己有深入了解，有好好寫一定可以寫到 90 分左右。這時這篇突出的 PS 可能就成為了說服學校錄取你的關鍵！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9218ef25b7dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>