Skip to content

Commit 0ce22ce

Browse files
committed
add training ResNet-50 from scratch using pytorch notes
1 parent 5acc458 commit 0ce22ce

File tree

187 files changed

+1266
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+1266
-295
lines changed

404.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>404 Page not found // davidgao7 blog</title>
55
<link rel="shortcut icon" href="/favicon.ico" />
66
<meta charset="utf-8" />
7-
<meta name="generator" content="Hugo 0.146.6">
7+
<meta name="generator" content="Hugo 0.146.7">
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
<meta name="author" content="David Gao" />
1010
<meta name="description" content="" />

_Index_of_public.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
%% Zoottelkeeper: Beginning of the autogenerated index file list %%
2+
[[davidgao7blogs/public/_index_of_content/_Index_of__index_of_content|_Index_of__index_of_content]]
3+
[[davidgao7blogs/public/404.html|404.html]]
4+
[[davidgao7blogs/public/avatar.jpg|avatar.jpg]]
5+
[[davidgao7blogs/public/categories/_Index_of_categories|_Index_of_categories]]
6+
[[davidgao7blogs/public/css/_Index_of_css|_Index_of_css]]
7+
[[davidgao7blogs/public/images/_Index_of_images|_Index_of_images]]
8+
[[davidgao7blogs/public/index.html|index.html]]
9+
[[davidgao7blogs/public/index.xml|index.xml]]
10+
[[davidgao7blogs/public/page/_Index_of_page|_Index_of_page]]
11+
[[davidgao7blogs/public/plotly/_Index_of_plotly|_Index_of_plotly]]
12+
[[davidgao7blogs/public/posts/_Index_of_posts|_Index_of_posts]]
213
[[davidgao7blogs/public/README|README]]
14+
[[davidgao7blogs/public/sitemap.xml|sitemap.xml]]
15+
[[davidgao7blogs/public/tags/_Index_of_tags|_Index_of_tags]]
316
%% Zoottelkeeper: End of the autogenerated index file list %%

_index_of_content/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title> // davidgao7 blog</title>
55
<link rel="shortcut icon" href="/favicon.ico" />
66
<meta charset="utf-8" />
7-
<meta name="generator" content="Hugo 0.146.6">
7+
<meta name="generator" content="Hugo 0.146.7">
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
<meta name="author" content="David Gao" />
1010
<meta name="description" content="" />

categories/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>Categories // davidgao7 blog</title>
55
<link rel="shortcut icon" href="/favicon.ico" />
66
<meta charset="utf-8" />
7-
<meta name="generator" content="Hugo 0.146.6">
7+
<meta name="generator" content="Hugo 0.146.7">
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
<meta name="author" content="David Gao" />
1010
<meta name="description" content="" />

index.html

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>davidgao7 blog</title>
55
<link rel="shortcut icon" href="/favicon.ico" />
66
<meta charset="utf-8" />
7-
<meta name="generator" content="Hugo 0.146.6">
7+
<meta name="generator" content="Hugo 0.146.7">
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
<meta name="author" content="David Gao" />
1010
<meta name="description" content="Note new findings every day to let the magic happen!" />
@@ -53,6 +53,17 @@ <h1>davidgao7 blog</h1>
5353

5454
<ul class="posts-list">
5555

56+
<li class="posts-list-item">
57+
<a class="posts-list-item-title" href="/posts/training-resnet-using-pytorch/">Training Resnet Using Pytorch</a>
58+
<span class="posts-list-item-description">
59+
<svg class="icon icon-calendar" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>calendar</title><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
60+
Apr 23, 2025
61+
<span class="posts-list-item-separator">-</span>
62+
<svg class="icon icon-clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>clock</title><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
63+
9 min read
64+
</span>
65+
</li>
66+
5667
<li class="posts-list-item">
5768
<a class="posts-list-item-title" href="/posts/finetune-llm-using-pytorch/">Finetune LLM Using Pytorch</a>
5869
<span class="posts-list-item-description">
@@ -152,17 +163,6 @@ <h1>davidgao7 blog</h1>
152163
</span>
153164
</li>
154165

155-
<li class="posts-list-item">
156-
<a class="posts-list-item-title" href="/posts/symmetric-tree/">Symmetric Tree</a>
157-
<span class="posts-list-item-description">
158-
<svg class="icon icon-calendar" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>calendar</title><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
159-
Feb 16, 2025
160-
<span class="posts-list-item-separator">-</span>
161-
<svg class="icon icon-clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>clock</title><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
162-
2 min read
163-
</span>
164-
</li>
165-
166166
</ul>
167167

168168

index.xml

+9-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66
<description>Recent content on davidgao7 blog</description>
77
<generator>Hugo</generator>
88
<language>en-us</language>
9-
<lastBuildDate>Tue, 22 Apr 2025 21:08:11 -0400</lastBuildDate>
9+
<lastBuildDate>Wed, 23 Apr 2025 22:34:35 -0400</lastBuildDate>
1010
<atom:link href="http://localhost:1313/index.xml" rel="self" type="application/rss+xml" />
11+
<item>
12+
<title>Training Resnet Using Pytorch</title>
13+
<link>http://localhost:1313/posts/training-resnet-using-pytorch/</link>
14+
<pubDate>Wed, 23 Apr 2025 22:34:35 -0400</pubDate>
15+
<guid>http://localhost:1313/posts/training-resnet-using-pytorch/</guid>
16+
<description>&lt;h1 id=&#34;re-visit-convolutional-neural-network-cnn-architectures-plainnet--resnet-using-pytorch&#34;&gt;Re-visit Convolutional Neural Network (CNN) Architectures: PlainNet &amp;amp; ResNet using Pytorch&lt;/h1&gt;&#xA;&lt;p&gt;In this blog I will use pytorch to rebuild a classic vision model: &lt;code&gt;ResNet-50&lt;/code&gt;, to get more hands on exercise for real-world computer vision application&lt;/p&gt;&#xA;&lt;h2 id=&#34;preparation&#34;&gt;Preparation&lt;/h2&gt;&#xA;&lt;p&gt;Please make sure you have the following packages installed:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;torch&#xA;torchvision&#xA;plotly&#xA;IPython&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Import the libraries, and check the GPU availability. If you are using a Mac with MPS, it will automatically use the MPS device. Otherwise, it will use the CUDA device if available.&lt;/p&gt;</description>
17+
</item>
1118
<item>
1219
<title>Finetune LLM Using Pytorch</title>
1320
<link>http://localhost:1313/posts/finetune-llm-using-pytorch/</link>
@@ -230,7 +237,7 @@
230237
<link>http://localhost:1313/posts/_index_of_posts/</link>
231238
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
232239
<guid>http://localhost:1313/posts/_index_of_posts/</guid>
233-
<description>&lt;p&gt;%% Zoottelkeeper: Beginning of the autogenerated index file list %%&#xA;[[davidgao7blogs/content/posts/array-summary|array-summary]]&#xA;[[davidgao7blogs/content/posts/binary-tree-path-sum|binary-tree-path-sum]]&#xA;[[davidgao7blogs/content/posts/binaryTree-Output-levely|binaryTree-Output-levely]]&#xA;[[davidgao7blogs/content/posts/copy-random-list|copy-random-list]]&#xA;[[davidgao7blogs/content/posts/cout-vowel-strings|cout-vowel-strings]]&#xA;[[davidgao7blogs/content/posts/divide-arr-into-arr-with-max-diff|divide-arr-into-arr-with-max-diff]]&#xA;[[davidgao7blogs/content/posts/evolution-of-route-planning-in-urban-env|evolution-of-route-planning-in-urban-env]]&#xA;[[davidgao7blogs/content/posts/find-kth-largest|find-kth-largest]]&#xA;[[davidgao7blogs/content/posts/Finetune-LLM-Locally-using-MLX|Finetune-LLM-Locally-using-MLX]]&#xA;[[davidgao7blogs/content/posts/Finetune-LLM-using-pytorch|Finetune-LLM-using-pytorch]]&#xA;[[davidgao7blogs/content/posts/go-syntax-learning|go-syntax-learning]]&#xA;[[davidgao7blogs/content/posts/grafana-prometheus|grafana-prometheus]]&#xA;[[davidgao7blogs/content/posts/heap-bst|heap-bst]]&#xA;[[davidgao7blogs/content/posts/how-to-build-n8n-agent-from-scratch|how-to-build-n8n-agent-from-scratch]]&#xA;[[davidgao7blogs/content/posts/jump-game|jump-game]]&#xA;[[davidgao7blogs/content/posts/LLM-Production|LLM-Production]]&#xA;[[davidgao7blogs/content/posts/local-rag-ollama|local-rag-ollama]]&#xA;[[davidgao7blogs/content/posts/lowest-common-ancestor|lowest-common-ancestor]]&#xA;[[davidgao7blogs/content/posts/machine-learning-pipeline|machine-learning-pipeline]]&#xA;[[davidgao7blogs/content/posts/maxLength|maxLength]]&#xA;[[davidgao7blogs/content/posts/merge-k-sorted-lists|merge-k-sorted-lists]]&#xA;[[davidgao7blogs/content/posts/minimum-length-encoding|minimum-length-encoding]]&#xA;[[davidgao7blogs/content/posts/rob|rob]]&#xA;[[davidgao7blogs/content/posts/shortest-bridge|shortest-bridge]]&#xA;[[davidgao7blogs/content/posts/SVM|SVM]]&#xA;[[davidgao7blogs/content/posts/symmetric-tree|symmetric-tree]]&#xA;[[davidgao7blogs/content/posts/TCP-rust|TCP-rust]]&#xA;[[davidgao7blogs/content/posts/valid-word-abbr|valid-word-abbr]]&#xA;[[davidgao7blogs/content/posts/virtual-machine|virtual-machine]]&#xA;[[davidgao7blogs/content/posts/vLLM-deep-dive|vLLM-deep-dive]]&#xA;%% Zoottelkeeper: End of the autogenerated index file list %%&lt;/p&gt;</description>
240+
<description>&lt;p&gt;%% Zoottelkeeper: Beginning of the autogenerated index file list %%&#xA;[[davidgao7blogs/content/posts/array-summary|array-summary]]&#xA;[[davidgao7blogs/content/posts/binary-tree-path-sum|binary-tree-path-sum]]&#xA;[[davidgao7blogs/content/posts/binaryTree-Output-levely|binaryTree-Output-levely]]&#xA;[[davidgao7blogs/content/posts/copy-random-list|copy-random-list]]&#xA;[[davidgao7blogs/content/posts/cout-vowel-strings|cout-vowel-strings]]&#xA;[[davidgao7blogs/content/posts/divide-arr-into-arr-with-max-diff|divide-arr-into-arr-with-max-diff]]&#xA;[[davidgao7blogs/content/posts/evolution-of-route-planning-in-urban-env|evolution-of-route-planning-in-urban-env]]&#xA;[[davidgao7blogs/content/posts/find-kth-largest|find-kth-largest]]&#xA;[[davidgao7blogs/content/posts/Finetune-LLM-Locally-using-MLX|Finetune-LLM-Locally-using-MLX]]&#xA;[[davidgao7blogs/content/posts/Finetune-LLM-using-pytorch|Finetune-LLM-using-pytorch]]&#xA;[[davidgao7blogs/content/posts/go-syntax-learning|go-syntax-learning]]&#xA;[[davidgao7blogs/content/posts/grafana-prometheus|grafana-prometheus]]&#xA;[[davidgao7blogs/content/posts/heap-bst|heap-bst]]&#xA;[[davidgao7blogs/content/posts/how-to-build-n8n-agent-from-scratch|how-to-build-n8n-agent-from-scratch]]&#xA;[[davidgao7blogs/content/posts/jump-game|jump-game]]&#xA;[[davidgao7blogs/content/posts/LLM-Production|LLM-Production]]&#xA;[[davidgao7blogs/content/posts/local-rag-ollama|local-rag-ollama]]&#xA;[[davidgao7blogs/content/posts/lowest-common-ancestor|lowest-common-ancestor]]&#xA;[[davidgao7blogs/content/posts/machine-learning-pipeline|machine-learning-pipeline]]&#xA;[[davidgao7blogs/content/posts/maxLength|maxLength]]&#xA;[[davidgao7blogs/content/posts/merge-k-sorted-lists|merge-k-sorted-lists]]&#xA;[[davidgao7blogs/content/posts/minimum-length-encoding|minimum-length-encoding]]&#xA;[[davidgao7blogs/content/posts/rob|rob]]&#xA;[[davidgao7blogs/content/posts/shortest-bridge|shortest-bridge]]&#xA;[[davidgao7blogs/content/posts/SVM|SVM]]&#xA;[[davidgao7blogs/content/posts/symmetric-tree|symmetric-tree]]&#xA;[[davidgao7blogs/content/posts/TCP-rust|TCP-rust]]&#xA;[[davidgao7blogs/content/posts/Training-resnet-using-pytorch|Training-resnet-using-pytorch]]&#xA;[[davidgao7blogs/content/posts/valid-word-abbr|valid-word-abbr]]&#xA;[[davidgao7blogs/content/posts/virtual-machine|virtual-machine]]&#xA;[[davidgao7blogs/content/posts/vLLM-deep-dive|vLLM-deep-dive]]&#xA;%% Zoottelkeeper: End of the autogenerated index file list %%&lt;/p&gt;</description>
234241
</item>
235242
</channel>
236243
</rss>

page/2/index.html

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>davidgao7 blog</title>
55
<link rel="shortcut icon" href="/favicon.ico" />
66
<meta charset="utf-8" />
7-
<meta name="generator" content="Hugo 0.146.6">
7+
<meta name="generator" content="Hugo 0.146.7">
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
<meta name="author" content="David Gao" />
1010
<meta name="description" content="Note new findings every day to let the magic happen!" />
@@ -53,6 +53,17 @@ <h1>davidgao7 blog</h1>
5353

5454
<ul class="posts-list">
5555

56+
<li class="posts-list-item">
57+
<a class="posts-list-item-title" href="/posts/symmetric-tree/">Symmetric Tree</a>
58+
<span class="posts-list-item-description">
59+
<svg class="icon icon-calendar" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>calendar</title><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
60+
Feb 16, 2025
61+
<span class="posts-list-item-separator">-</span>
62+
<svg class="icon icon-clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>clock</title><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
63+
2 min read
64+
</span>
65+
</li>
66+
5667
<li class="posts-list-item">
5768
<a class="posts-list-item-title" href="/posts/local-rag-ollama/">Local Rag Ollama</a>
5869
<span class="posts-list-item-description">
@@ -152,17 +163,6 @@ <h1>davidgao7 blog</h1>
152163
</span>
153164
</li>
154165

155-
<li class="posts-list-item">
156-
<a class="posts-list-item-title" href="/posts/jump-game/">Jump Game</a>
157-
<span class="posts-list-item-description">
158-
<svg class="icon icon-calendar" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>calendar</title><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
159-
Feb 7, 2025
160-
<span class="posts-list-item-separator">-</span>
161-
<svg class="icon icon-clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>clock</title><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
162-
1 min read
163-
</span>
164-
</li>
165-
166166
</ul>
167167

168168

page/3/index.html

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>davidgao7 blog</title>
55
<link rel="shortcut icon" href="/favicon.ico" />
66
<meta charset="utf-8" />
7-
<meta name="generator" content="Hugo 0.146.6">
7+
<meta name="generator" content="Hugo 0.146.7">
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
<meta name="author" content="David Gao" />
1010
<meta name="description" content="Note new findings every day to let the magic happen!" />
@@ -53,6 +53,17 @@ <h1>davidgao7 blog</h1>
5353

5454
<ul class="posts-list">
5555

56+
<li class="posts-list-item">
57+
<a class="posts-list-item-title" href="/posts/jump-game/">Jump Game</a>
58+
<span class="posts-list-item-description">
59+
<svg class="icon icon-calendar" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>calendar</title><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
60+
Feb 7, 2025
61+
<span class="posts-list-item-separator">-</span>
62+
<svg class="icon icon-clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>clock</title><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
63+
1 min read
64+
</span>
65+
</li>
66+
5667
<li class="posts-list-item">
5768
<a class="posts-list-item-title" href="/posts/minimum-length-encoding/">Minimum Length Encoding</a>
5869
<span class="posts-list-item-description">
@@ -152,17 +163,6 @@ <h1>davidgao7 blog</h1>
152163
</span>
153164
</li>
154165

155-
<li class="posts-list-item">
156-
<a class="posts-list-item-title" href="/posts/machine-learning-pipeline/">Machine Learning Pipeline</a>
157-
<span class="posts-list-item-description">
158-
<svg class="icon icon-calendar" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>calendar</title><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
159-
Feb 7, 2025
160-
<span class="posts-list-item-separator">-</span>
161-
<svg class="icon icon-clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>clock</title><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
162-
1 min read
163-
</span>
164-
</li>
165-
166166
</ul>
167167

168168

page/4/index.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>davidgao7 blog</title>
55
<link rel="shortcut icon" href="/favicon.ico" />
66
<meta charset="utf-8" />
7-
<meta name="generator" content="Hugo 0.146.6">
7+
<meta name="generator" content="Hugo 0.146.7">
88
<meta name="viewport" content="width=device-width, initial-scale=1" />
99
<meta name="author" content="David Gao" />
1010
<meta name="description" content="Note new findings every day to let the magic happen!" />
@@ -53,6 +53,17 @@ <h1>davidgao7 blog</h1>
5353

5454
<ul class="posts-list">
5555

56+
<li class="posts-list-item">
57+
<a class="posts-list-item-title" href="/posts/machine-learning-pipeline/">Machine Learning Pipeline</a>
58+
<span class="posts-list-item-description">
59+
<svg class="icon icon-calendar" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>calendar</title><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
60+
Feb 7, 2025
61+
<span class="posts-list-item-separator">-</span>
62+
<svg class="icon icon-clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><title>clock</title><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
63+
1 min read
64+
</span>
65+
</li>
66+
5667
<li class="posts-list-item">
5768
<a class="posts-list-item-title" href="/posts/_index_of_posts/"></a>
5869
<span class="posts-list-item-description">

plotly/ResNetPytorch.html

+14
Large diffs are not rendered by default.

plotly/ResNetPytorchDataAug.html

+14
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)