Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit c176a12

Browse files
authored
[v1.1][ISSUE-274] refine ResNet and MiniGo demo and resize pictures (#288)
* refine * refine * refine * refine
1 parent 54b5164 commit c176a12

2 files changed

Lines changed: 50 additions & 43 deletions

File tree

demo/builtin/minigo/MiniGo_DEMO.ipynb

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,16 @@
1212
{
1313
"attachments": {},
1414
"cell_type": "markdown",
15-
"id": "7e90b29d",
15+
"id": "a358045c",
1616
"metadata": {},
1717
"source": [
18-
"# Content\n",
19-
"* [Overview](#Overview)\n",
20-
" * [Model Architecture](#Model-Architecture)\n",
21-
" * [Optimizations](#Optimizations)\n",
22-
" * [Performance](#Performance)\n",
23-
"* [Getting Started](#Getting-Started)\n",
24-
" * [1. Environment Setup](#1.-Environment-Setup)\n",
25-
" * [2. Workflow Prepare](#2.-Workflow-Prepare)\n",
26-
" * [3. Data Prepare](#3.-Data-Prepare)\n",
27-
" * [4. Train](#4.-Train)"
28-
]
29-
},
30-
{
31-
"cell_type": "markdown",
32-
"id": "60ba275a",
33-
"metadata": {},
34-
"source": [
35-
"## MiniGo"
18+
"## MiniGo DEMO"
3619
]
3720
},
3821
{
22+
"attachments": {},
3923
"cell_type": "markdown",
40-
"id": "b004c1af",
24+
"id": "0ed0530e",
4125
"metadata": {},
4226
"source": [
4327
"MiniGo is an opensource minimalist Go engine modeled after AlphaGo Zero, which is a system that learns how to play Go at a superhuman level given only the rules of the game.\n",
@@ -50,6 +34,24 @@
5034
"Reference: https://www.newyorker.com/science/elements/how-the-artificial-intelligence-program-alphazero-mastered-its-games"
5135
]
5236
},
37+
{
38+
"attachments": {},
39+
"cell_type": "markdown",
40+
"id": "7e90b29d",
41+
"metadata": {},
42+
"source": [
43+
"# Content\n",
44+
"* [Overview](#Overview)\n",
45+
" * [Model Architecture](#Model-Architecture)\n",
46+
" * [Optimizations](#Optimizations)\n",
47+
" * [Performance](#Performance)\n",
48+
"* [Getting Started](#Getting-Started)\n",
49+
" * [1. Environment Setup](#1.-Environment-Setup)\n",
50+
" * [2. Workflow Prepare](#2.-Workflow-Prepare)\n",
51+
" * [3. Data Prepare](#3.-Data-Prepare)\n",
52+
" * [4. Train](#4.-Train)"
53+
]
54+
},
5355
{
5456
"attachments": {},
5557
"cell_type": "markdown",
@@ -59,13 +61,13 @@
5961
"# Overview\n",
6062
"## Model Architecture\n",
6163
"### Overall train loop architecture of MiniGo\n",
62-
"<img src=\"./img/minigo_model_arch.png\" width=\"800\"/><figure>MiniGo Model Architecture</figure>\n",
64+
"<img src=\"./img/minigo_model_arch.png\" width=\"600\"/><figure>MiniGo Model Architecture</figure>\n",
6365
"\n",
6466
"### Deep network architecture based on residual blocks\n",
65-
"<img src=\"./img/minigo_nn_arch.png\" width=\"800\"/><figure>Neural Network Architecture</figure>\n",
67+
"<img src=\"./img/minigo_nn_arch.png\" width=\"600\"/><figure>Neural Network Architecture</figure>\n",
6668
"\n",
6769
"### MCTS architecture (Select->Expand->Evaluate->Backup/Backpropagation)\n",
68-
"<img src=\"./img/minigo_mcts_arch.png\" width=\"800\"/><figure>Monte Carlo Tree Search in MiniGo</figure>"
70+
"<img src=\"./img/minigo_mcts_arch.png\" width=\"600\"/><figure>Monte Carlo Tree Search in MiniGo</figure>"
6971
]
7072
},
7173
{
@@ -283,6 +285,7 @@
283285
]
284286
},
285287
{
288+
"attachments": {},
286289
"cell_type": "markdown",
287290
"id": "92f794fe",
288291
"metadata": {},
@@ -292,7 +295,7 @@
292295
"Remark:\n",
293296
"* Use rsync to synchronize signal, trained model, and mcts generated datset\n",
294297
"* Enable numa binding to fully utilize all physical cores in the cluster\n",
295-
"<img src=\"./img/minigo_optimized_system_arch.JPG\" width=\"800\"/><figure>Optimized MiniGo System Architecture</figure>\n",
298+
"<img src=\"./img/minigo_optimized_system_arch.JPG\" width=\"600\"/><figure>Optimized MiniGo System Architecture</figure>\n",
296299
"\n",
297300
"### Enable early stop during the train loop to leverage fast converge\n",
298301
"Remark:\n",
@@ -311,9 +314,9 @@
311314
"** num_readouts=600\n",
312315
"** fastplay_readouts=60\n",
313316
"* MCTS performance without finetune:\n",
314-
"<img src=\"./img/mcts_baseline_speed.JPG\" width=\"800\"/><figure>Baseline MCTS</figure>\n",
317+
"<img src=\"./img/mcts_baseline_speed.JPG\" width=\"600\"/><figure>Baseline MCTS</figure>\n",
315318
"* MCTS performance with finetune:\n",
316-
"<img src=\"./img/mcts_tuned_speed.JPG\" width=\"800\"/><figure>Finetuned MCTS</figure>\n"
319+
"<img src=\"./img/mcts_tuned_speed.JPG\" width=\"600\"/><figure>Finetuned MCTS</figure>\n"
317320
]
318321
},
319322
{
@@ -324,7 +327,7 @@
324327
"source": [
325328
"## Performance\n",
326329
"\n",
327-
"<img src=\"./img/minigo_perf.png\" width=\"900\"/>\n",
330+
"<img src=\"./img/minigo_perf.png\" width=\"600\"/>\n",
328331
"\n",
329332
"* Distributed training with HW scaling delivered 3.57 speedup from 1 node to 4 nodes\n",
330333
"* Parallel selfplay and enable early stop delivered 2.50x speedup, and 8.92x speedup over baseline\n",
@@ -364,6 +367,7 @@
364367
"metadata": {},
365368
"outputs": [],
366369
"source": [
370+
"# Noted: MiniGo is only runnable with baremetal env, so we won't provide docker option\n",
367371
"%%bash\n",
368372
"# prepare model codes\n",
369373
"bash workflow_prepare_minigo.sh\n",
@@ -484,6 +488,8 @@
484488
"metadata": {},
485489
"source": [
486490
"## 4. Train\n",
491+
"Noted: Below performance result is using sample dataset and small iterations to demonstrate its function. The actual performance result please refers to the [performance section](#performance).\n",
492+
"\n",
487493
"Edit config file to control SDA process"
488494
]
489495
},

demo/builtin/resnet/RESNET_DEMO.ipynb

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@
99
]
1010
},
1111
{
12+
"attachments": {},
1213
"cell_type": "markdown",
1314
"metadata": {},
1415
"source": [
15-
"# RESNET Demo"
16+
"# RESNET Demo\n",
17+
"ResNet, short for Residual Network is a specific type of neural network that was introduced in paper “Deep Residual Learning for Image Recognition”.\n",
18+
"\n",
19+
"* original source\n",
20+
" * Source repo: https://github.com/mlcommons/training_results_v1.0/tree/master/Intel/benchmarks/resnet/2-nodes-16s-8376H-tensorflow"
1621
]
1722
},
1823
{
@@ -32,15 +37,6 @@
3237
" * [4. Train](#4.-Train)"
3338
]
3439
},
35-
{
36-
"cell_type": "markdown",
37-
"metadata": {},
38-
"source": [
39-
"## Image Classification\n",
40-
"* Classify different images into different categories to achieve the smallest classification error. Image classification is a supervised learning problem: define a set of target classes (objects to identify in images), and train a model to recognize them using labeled example photos.\n",
41-
"![image_classification.png](./img/image_classification.png)\n"
42-
]
43-
},
4440
{
4541
"attachments": {},
4642
"cell_type": "markdown",
@@ -50,19 +46,22 @@
5046
"\n",
5147
"## Model Architecture\n",
5248
"\n",
49+
"### Image Classification\n",
50+
"* Classify different images into different categories to achieve the smallest classification error. Image classification is a supervised learning problem: define a set of target classes (objects to identify in images), and train a model to recognize them using labeled example photos.\n",
51+
"<div><img src=\"./img/image_classification.png\" alt=\"image_classification.png\" width=\"600\"></div>\n",
52+
"\n",
5353
"### VGG Neural Networks\n",
5454
"* VGG stands for Visual Geometry Group; it is a standard deep Convolutional Neural Network (CNN) architecture with multiple layers. The “deep” refers to the number of layers with VGG-16 or VGG-19 consisting of 16 and 19 convolutional layers. \n",
5555
"* The VGG architecture is the basis of ground-breaking object recognition models. Developed as a deep neural network, the VGGNet also surpasses baselines on many tasks and datasets beyond ImageNet. Moreover, it is now still one of the most popular image recognition architectures.\n",
5656
"\n",
57-
"\n",
58-
"![resnet.png](./img/resnet.png)\n",
57+
"<div><img src=\"./img/resnet.png\" alt=\"resnet.png\"></div>\n",
5958
"### Deep Residual Learning for Image Recognition(ResNet)\n",
6059
"Deep residual networks like the popular ResNet-50 model is a convolutional neural network (CNN) that is 50 layers deep. A Residual Neural Network (ResNet) is an Artificial Neural Network (ANN) of a kind that stacks residual(shown as below image) blocks on top of each other to form a network.\n",
6160
"\n",
6261
"A residual network is a stack of many residual blocks. Regular design, like VGG: each residual block has two 3x3 conv. \n",
6362
"The Network is divided into stages: the first block of each stage halves the resolution (with stride-2 conv) and doubles the number of channels\n",
6463
"\n",
65-
"![residual.png](./img/residual.png)"
64+
"<div><img src=\"./img/residual.png\" alt=\"residual.png\"></div>"
6665
]
6766
},
6867
{
@@ -122,7 +121,7 @@
122121
"source": [
123122
"## Performance\n",
124123
"\n",
125-
"<img src=\"./img/resnet_perf.png\" width=\"900\"/>\n",
124+
"<img src=\"./img/resnet_perf.png\" width=\"600\"/>\n",
126125
"\n",
127126
"* Distributed training with HW scaling delivered 3.84x speedup from 1 node to 4 nodes\n",
128127
"* HPO (hyper parameter optimization) with SDA (a component of AIOK, smart democratization advisor) delivered 1.21x speedup, and 4.63x speedup over baseline\n",
@@ -152,7 +151,7 @@
152151
"metadata": {},
153152
"source": [
154153
"## 1. Environment Setup\n",
155-
"### Option 1 Setup Environment with Pip\n",
154+
"### (Option 1) Use Pip Install\n",
156155
"pre-work: move e2eAIOK source code to /home/vmagent/app/e2eaiok."
157156
]
158157
},
@@ -178,7 +177,7 @@
178177
"cell_type": "markdown",
179178
"metadata": {},
180179
"source": [
181-
"### Option 2 Setup Environment with Docker\n",
180+
"### (Option 2) Use Docker\n",
182181
"\n",
183182
"Step1. prepare code\n",
184183
"``` bash\n",
@@ -267,6 +266,8 @@
267266
"metadata": {},
268267
"source": [
269268
"## 4. Train\n",
269+
"Noted: Below performance result is using sample dataset and small iterations to demonstrate its function. The actual performance result please refers to the [performance section](#performance).\n",
270+
"\n",
270271
"Edit config file to control SDA process"
271272
]
272273
},

0 commit comments

Comments
 (0)