Weng Chi-Hung

@chweng

Joined on Dec 24, 2016

  • 講義與程式範例下載 講義 資料集和程式 20240219 Review VSCode Setup: linter, formatter Loss: MSEMean Square Error:給定第i個樣本 $(x^{(i)}, y^{(i)})$, 模型對樣本$x^{(i)}$的預測: $\hat{y}^{(i)}$, 可定義出第i個樣本的誤差$l^{(i)} := (y^{(i)} - \hat{y}^{(i)})^2$ 考慮了所有樣本的誤差, 最終定義誤差 $L = \frac{1}{N}\sum_{i=1}^N l^{(i)} := \frac{1}{N} \sum_{i=1}^N (y^{(i)} - \hat{y}^{(i)})^2$ Optimizer: GD
     Like  Bookmark
  • 講義與程式範例下載 講義 程式範例 補充筆記 To Do 2023/11/04 [x] How to prepare Deep-learning DEV environment [x] Connection between Loss Minimization and Likelihood Maximization [x] What is Stochastic Gradient Descent
     Like  Bookmark
  • 課程內容 講義 資料集 Bad Smells SOLID 補充資訊 (2023/11/26) 何謂GiniIMG_0154 目標: 做好的決策 (選擇能夠最大化Gini的決策)
     Like  Bookmark
  • S (Single Responsibility Principle; 單一責任原則) 盡量一個小積木負責執行單一任務,不要做太多。 舉例 (影像分割)def segment_image_and_export_boolean_mask(image_rgb): image_gray = rgb2gray(image_rgb) boolean_mask = segmenter(image_gray) mask_to_save = boolean_mask.astype(np.uint8) * 255 cv2.imwrite('boolean_mask.png', mask_to_save)
     Like  Bookmark
  • 類別或方法過長 Long Method 簡介:有個類的方法裡面邏輯很多/很雜亂/很長。 我們可能會想要盡量將邏輯拆分成多個專一的小邏輯,因為:如果可以細看到大房子如何以每個負責不同功能的小積木組成,將有助於理解大房子的架構。 小積木也比較好去個別理解/修改/除錯。 缺點: 阻礙理解。
     Like  Bookmark
  • [講義下載] [資料集下載] [課程補充筆記本] 作業 Q: 在模型權重數量差不多時, 我們有兩種建模策略: (A) 寬但淺 (淺層網路; 隱藏層很少, 中間只激活少數次; 網路層內有較多神經元) (B) 窄但深 (深層網路; 中間會激活很多次; 網路層內有較少神經元) 這兩種建模策略哪一個可能比較好呢? 你可能要建立一個統計表格, 該表格包含: model_setting, num_weights, accuracy等欄位. 這樣會比較好回答此申論問題. 不用太嚴謹或複雜. 簡單實驗, 給出一些說明即可.
     Like  Bookmark
  • 課程內容下載 資料集 dataloader.py densenet.py Notebook 課程環境設定 本課程將使用GPU運行深度學習環境。 為了避免上課花費過多時間在環境安裝與設定,請同學預先安裝 WSL2, CUDA, 和 cuDNN。
     Like  Bookmark
  • 安裝和設定: GPU相關套件 安裝NVIDIA Driver (此步驟可能可略過,因為教室的機器應該都有安裝好NVIDIA驅動程式) 設定NVSMI (看NVIDIA DRIVER有沒有裝好)。 將C:\Program Files\NVIDIA Corporation\NVSMI加入System PATH。 加入後, 開啟終端機 (如GIT BASH或Windows命令提示字元), 然後輸入nvidia-smi.exe, 按Enter, 即可顯示出GPU使用率等資訊。 安裝CUDA v11.3.10。[下載連結]
     Like  Bookmark
  • 記得以下網址, 方便之後回來此頁面: https://hackmd.io/@chweng/bdse-20 資料下載 2021/08/24 [講義, 資料集, 部分範例程式] (下載密碼: 20bdse) 2021/09/01
     Like  Bookmark
  • 本頁連結: https://bit.ly/3oyWRrN 資料下載 2021/05/19 [Notebook 6-9] [PhysioNet資料集] 補充投影片
     Like  Bookmark
  • 本頁連結: https://bit.ly/32bYPUL 檔案下載 講義 範例程式 & 資料集 環境 若為Windows環境 (無GPU),請安裝Anaconda後,加裝如下套件:
     Like 1 Bookmark
  • 本頁連結: https://hackmd.io/@chweng/bdse13 安裝CUDA 設定NVSMI (看NVIDIA DRIVER有沒有裝好) 將C:\Program Files\NVIDIA Corporation\NVSMI加入System PATH 加入後, 開啟終端機(如GIT BASH), 然後輸入nvidia-smi.exe, 按Enter, 即可顯示出GPU使用率等資訊 安裝cuDNN 將解壓縮後的資料, 逐一複製到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
     Like  Bookmark
  • GN class GroupNorm(nn.HybridBlock): """ If the batch size is small, it's better to use GroupNorm instead of BatchNorm. GroupNorm achieves good results even at small batch sizes. Reference: https://arxiv.org/pdf/1803.08494.pdf """ def __init__(self, num_channels, num_groups=32, eps=1e-5, **kwargs):
     Like  Bookmark
  • https://www.dropbox.com/s/zzp8zgmwf6qqu69/xavier_benchmark.tar.gz?dl=0
     Like  Bookmark
  • Experiment 1 Model: MobileNetV2 Data: 224 X 224 images; 8 images only Input tensor: (8,224,224,3) Throughput TensorFlow only: Throughput: 62 images/s TensorRT FP32: Throughput: 599 images/s TensorRT FP16: Throughput: 1101 images/s
     Like  Bookmark
  • Target audience: have some experience in programming knowing how to write for-loop and Class in Python Goal of the workshop: Understand principles of Deep Learning Get familiarized with TensorFlow 2.0 API Multi-GPU and Mixed-Precision Training
     Like  Bookmark
  • def iou(box0, box1): # box0: [x,y,z,rr], where (x,y,z) is the center of a circle; r is the radius r0 = box0[3] / 2 # half of the radius s0 = box0[:3] - r0 # convert `center` to a `lower-left vertice of a box`; i.e. (x,y,z) -> (x-r, y-r, z-r) e0 = box0[:3] + r0 # convert `center` to a `top-right vertice of a box`; i.e. (x,y,z) -> (x+r, y+r, z+r) r1 = box1[3] / 2 s1 = box1[:3] - r1
     Like  Bookmark
  • # IIIEDU-BDSE12-ML-DL-with-Python 本頁連結: https://hackmd.io/@chweng/bdse12 ## 檔案下載 * [講義](https://www.dropbox.com/s/iw2tzrfb6f1i9as/bdse12ml-and-dl.pdf?dl=0) ## 環境 ### Windows (無GPU) 若為Windows環境 (無GPU),請安裝Anaconda後,加裝如下套件: * 基本套件 ```bash pip install pandas matplotlib seaborn numpy scipy ``` * 機器學習套件 ```bash pip install tensorflow sklearn xgboost==0.90 ``` * 其它套件 ```bash pip install pillow graphviz pip install mlxtend pip install numexpr conda inst
     Like  Bookmark
  • # 資策會AIGO docker images 視訊教學 ## 可能的教學 ### Docker介紹 (pull, run, inspect, mount volume,...) ### 0、通用教學 CPU(25分鐘) * Docker * 簡單docker指令,如啟動GPU * 啟動AIGO容器的方法示範 * 用容器測試CPU ### 1、通用教學 GPU(25分鐘) * GPU support list * nvidia-driver * docker * nvidia container toolkit * 簡單docker指令,如啟動GPU * 啟動AIGO容器的方法示範 * 用容器測試GPU ### 2、一般開發者(`2-1: tf, 2-2: pytorch`) (45分鐘X 2) * 跑一些tf, keras pytorch的命令列端程式,如GPU/CPU benchmark * jupyter notebook/lab程式簡介 * moons dataset(sklearn介紹) ### 3、電腦視覺開發者 (`3-1: tf, 3-2: pytorc
     Like  Bookmark
  • # AIGO demo #### use FAIR (Facebook)'s '```detetron2``` for a demo of instance segmentation 1. Pull the image back to your host system: ```bash docker pull moeaidb/aigo:cu10.1-dnn7.6-gpu-pytorch-cv-19.12 ``` 2. Output the versions of installed packages/libs: ```bash rogerhu@honghutech:~$ docker run -it --rm moeaidb/aigo:cu10.1-dnn7.6-gpu-pytorch-cv-19.12 versions_summary System INFO: Python v3.7.5 NVIDIA Driver v430.26 C
     Like  Bookmark