1 of 92

AI人工智慧深度學習奇幻之旅_1

李柏翰

leepohan@gmail.com

7 August, 2021

*

1

2 of 92

*

2

https://quickdraw.withgoogle.com/

3 of 92

*

3

https://medium.com/@hiskio/生成對抗網路到底在gan麻-f149efb9eb6b

1.什麼是AI,ML,DL

4 of 92

*

4

30年深度學習的孤獨之旅!2018年圖靈獎「AI三巨頭」

認識AI三巨頭

Geoffrey Hinton 深度學習,卷積神經網路CNN之父

Yann LeCun 推動深度學習(DL),(pics from Wikipedia)

Yoshua Bengio,Learning Deep Architectures for AI

5 of 92

*

5

1956 年,美國弗蘭克・羅森布拉特(Frank Rosenblatt)基於神經元的理論發明瞭一種模擬神經元的方法。

它的基本點 🡺神經元的小單位的集合。

這些集合🡺都是小的計算單元🡺但可以模擬人腦計算的方式。

Rosenblatt 的學習算法🡺對於多層結構的神經網絡不起作用。

人工智慧學者們也因此放棄了學習式軟件的想法。

幾乎沒人再相信神經網絡的前景,也沒人再研究神經網絡。

除了 Hinton。

曾經被放棄的神經網絡

美國弗蘭克・羅森布拉特(Frank Rosenblatt)

https://www.psychspace.com/psych/action-printnews-itemid-12283.html

6 of 92

*

6

https://www.youtube.com/watch?v=l9RWTMNnvi4

Geoffrey Hinton 卷積神經網路之父 的故事

短短 8 分鐘紀錄片,特寫了這位「深度學習教父」,「有點皮」的教授,研究神經網絡 40 年的傳奇。

在手機上把語音轉化為文字的技術的實現,大部分功勞要歸於 Hinton 博士的研究。

https://buzzorange.com/techorange/2018/07/03/geoff-hinton-ai-founder/

7 of 92

*

7

Yoshua Bengio,Learning Deep Architectures for AI

Yoshua Bengio

因深度學習工作與Geoffrey Hinton和Yann LeCun共同分享了2018年圖靈獎,

🡺被公認為世界領先的AI專家和深度學習先驅。

🡺1964年,出生在法國巴黎,現與Hinton一樣選擇生活在加拿大,擁有加拿大CIFAR AI主席一職。

Bengio大學就讀於麥吉爾大學“計算機工程學”專業

🡺1986-1991年繼續修“計算機科學“到博士畢業

🡺1992年到美國AT&T貝爾實驗室LeCun小組做學習和視覺算法研究工作。

1993年起,他也是蒙特利爾學習算法研究所(MILA)創始人和科學主任。

🡺MILA,一家獨立的非營利組織,世界上最大的深度學習研究小組,擁有很多公司和AI創業公司的研究實驗室。

領先的AI專家和深度學習先驅

8 of 92

*

8

1、LeNet5卷積神經網絡提出:LeCun Y, Bottou L, Bengio Y, et al. Gradient-based learning applied to document recognition[J]. Proceedings of the IEEE, 1998, 86(11): 2278-2324.

2、NLP模型:Bengio Y, Ducharme R, Vincent P, et al. A neural probabilistic language model[J]. Journal of machine learning research, 2003, 3(Feb): 1137-1155.

3、逐層訓練方法:Bengio Y, Lamblin P, Popovici D, et al. Greedy layer-wise training of deep networks[C]//Advances in neural information processing systems. 2007: 153-160.

4、AI架構:Bengio Y. Learning deep architectures for AI[J]. Foundations and trends® in Machine Learning, 2009, 2(1): 1-127.

Yoshua Bengio代表性研究論文

9 of 92

*

9

機器學習分類

10 of 92

*

10

監督式學習

11 of 92

*

11

K-Means是什麼! 資料分群

找特徵

開始群心

EX:

K=2

非監督式學習

12 of 92

*

12

 

歐式距離計算

非監督式學習

13 of 92

*

13

非監督式學習

K-Means分群完畢,(魚長,體重)

14 of 92

*

14

 Ian Goodfellow,生成對抗網路(Generative Adversarial Network,GAN )之父, Yann LeCun認為是有史以來最酷的技術

GAN生成對抗網路

https://venturebeat.com/2019/12/26/gan-generative-adversarial-network-explainer-ai-machine-learning/

Ian Goodfellow

非監督式學習

15 of 92

*

15

學習 星夜 吶喊

原圖 海大一隅

生成式對抗網路

16 of 92

*

16

2. 面對AI風潮,我們家的小朋友該如何自處?

17 of 92

*

17

https://www.youtube.com/watch?v=nKW8Ndu7Mjw

2. 什麼是機器習(ML)

The 7 steps of machine learning

18 of 92

如何進入這個AI領域

*

18

自我學習聽大師演講

Take side projects

19 of 92

邀請大師演講�2020年12月18日,非常榮幸邀請台大電機李宏毅教授蒞臨附中演講,深度學習與人類語言處理,精彩深入的演講搏得滿堂喝彩,我們也學習很多。

*

19

20 of 92

AI & Python 自我精進

*

20

  1. 基本功:莫煩Python ( https://mofanpy.com/ )
  2. Machine Learning Crash Course (https://developers.google.com/machine-learning/crash-course)
  3. 深度學習 專業課程 (https://www.coursera.org/specializations/deep-learning)
  4. Comprehensive Python Cheatsheet,進去 Ctrl+F 搜尋一下可以找任何範例( https://gto76.github.io/python-cheatsheet/ )
  5. 自我學習資源 100-Days-Of-ML-Code ( https://github.com/Avik-Jain/100-Days-Of-ML-Code )
  6. 機器學習實戰 ( https://github.com/apachecn/AiLearning )
  7. hung-yi lee (李宏毅) (https://www.youtube.com/channel/UC2ggjtuuWvxrHHHiaDH1dlQ/featured)
  8. Fast.ai: PyTorch作為開發的工具,它先教你建立模型以後,再回頭告訴你為什麼這樣做。 (https://www.fast.ai/)
  9. BERT 科普文(https://leemeng.tw/attack_on_bert_transfer_learning_in_nlp.html)
  10. 林軒田教授( https://www.coursera.org/instructor/htlin )
  11. 【Keras 深度學習】#3 建立模型 | HiSKIO 程式語言線上教學 ( https://www.youtube.com/watch?v=JR8bo75U3fc )
  12. TensorFlow Playground( http://playground.tensorflow.org/ )

21 of 92

*

21

基本功 1:莫煩Python ( https://mofanpy.com/ )

22 of 92

*

22

基本功 2:K 書

23 of 92

*

23

基本功 2:K 書

24 of 92

*

24

基本功 2:K 書

25 of 92

*

25

基本功 2:K 書

26 of 92

*

26

基本功 2:K 書

27 of 92

*

27

和AI做朋友

https://www.openedu.tw/course.jsp?id=876

28 of 92

AI研究最難的是?

能問出一個好問題

然後,能自問自答

29 of 92

Q1.圍棋,AI可以贏人類嗎?

*

29

https://www.epochtimes.com/b5/16/3/16/n4663447.htm

2016年3月10日 AlphaGo對戰人類 李世乭 第二局

30 of 92

*

30

神之一手

在第36步之後…

α狗黑棋

石頭執白棋

31 of 92

*

31

神之一手

突然間..第37步α狗出現神之一手

α狗黑棋

石頭執白棋

32 of 92

*

32

神之一手:五路肩冲 (增強式學習)

大家看到在這第37步中,阿爾法狗落子在了第條線,進軍棋局的中部區域。與第四根線相比,這根線離中部區域更近。這可能意味著,在幾千年裡,人們嚴重低估了棋局中部區域的重要性。

33 of 92

*

33

李世石先生在第四場的時候,他做出了一步非常創新性的舉動,這一步迷惑阿爾法狗,使阿爾法狗決策樹進行了錯誤估計,稱之為「黃金之舉」

多少的哲理蘊含於圍棋中。阿爾法狗知道這是非常不尋常的一步,當時估計李世石通過這步贏的可能性是0.007%2分鐘裡,阿爾法狗需要重新搜索決策計算

人類圍棋對阿爾法狗AI唯一的1勝

34 of 92

*

34

2016年3月阿爾法狗大戰世界圍棋冠軍李世石,以4:1的總分戰勝了人類。

柯潔,世界圍棋冠軍,他也在網上和阿爾法狗對決過,比賽之後他說人類已經研究圍棋研究了幾千年了,然而人工智慧卻告訴我們,我們甚至連其表皮都尚未揭開

人類3000多年裡的圍棋觀不全然完整

傑米斯·哈薩比斯,Deep Mind創始人, AlphaGo之父。

35 of 92

挑戰蛋白質結構

Q2. DeepMind的下一步是?

36 of 92

*

36

人類最全蛋白質圖譜來了,果蠅小鼠甚至大腸桿菌蛋白質結構數據廣泛覆蓋。 2021年7月24日 週六 news

生物史最全“證件照”:DeepMind開放35萬蛋白質結構,超人類知識2倍

DeepMind挑戰蛋白質結構

37 of 92

*

37

人源中介體復合物(Mediator Complex)一直是結構生物學家最具挑戰性的多蛋白系統之一。(圖源:Nature)

DeepMind就打算將AI方面取得的突破在圍棋、游戲上進行測試,並將其應用於現實世界的問題,以加速科學突破並造福人類。

DeepMind推出了AlphaFold 2系統,可通過AI軟件對蛋白質結構進行預測

對蛋白質結構進行預測

38 of 92

*

38

AlphaFold預測的蛋白質結構的兩個例子(藍色)與實驗結果(綠色)的比較 (DeepMind)

利用AlphaFold來設計一種新型酶

以快速分解污染嚴重的一次性塑料等廢物

39 of 92

*

39

Q3. How to take side projects?

AI比賽,AI科展期刊論文

40 of 92

*

40

QABC 法則: side projects作品省思

Q: Query

A: Approach

B: Benefit

C: Compete

Q: 質疑

A: 達到目的之方法

B: 好處在哪

C: 競爭性

41 of 92

*

41

Q:作品有找出理論公式嗎?

Q:題目是自己想的嗎?

A:作品達到目的之方法為?

A:作品實驗的之方法為?如何量測?

B:作品有競爭性嗎?

B:自己覺得最好的結論是?

C:作品對人類好處在哪?是通則嗎?

C:如果還有時間,自己未來想改進哪裡?

QABC 法則: side projects作品省思

42 of 92

加入數學微分方程學習

微分方程

(1)常微分方程(ODE,Ordinary Differential Equations),只含一個獨立變數以及它的常導數,則稱為常微分方程。

(2)偏微分方程(PDE,Partial Differential Equations)

含有兩個或兩個以上獨立變數以及它的偏導數,則可定義此為偏微分方程。

Schrodinger equations 就是偏微分方程,變數 t,x

*

42

(free-particle)

43 of 92

*

43

3. 利用網路資源,進入機器學習(Machine Learning),深度學習(Deep Learning)。

44 of 92

*

44

4. TensorFlow Playground是個好幫手

https://playground.tensorflow.org/

45 of 92

*

45

5. CNN卷積神經網路,贏在起跑點

46 of 92

*

46

https://www.youtube.com/watch?v=aircAruvnKk

DL,深層神網路的概念

47 of 92

*

47

https://www.youtube.com/watch?v=IHZwWFHWa-w&t=769s

尋找最小誤差

48 of 92

*

48

https://poloclub.github.io/cnn-explainer/

CNN,卷積神經的DL

49 of 92

*

49

CNN,卷積神經的概念

50 of 92

*

50

6. 機器學習,深度學習可以做什麼?

https://teachablemachine.withgoogle.com/

51 of 92

*

51

Teachable Machine 可以做什麼?

52 of 92

*

52

https://teachablemachine.withgoogle.com/train/image

Teachable Machine – Image Project

53 of 92

*

53

�AI python 教學_1

54 of 92

*

54

https://walker-a.com/archives/6260

Anaconda 3 下載與安裝

55 of 92

*

55

Anaconda 3 安裝

56 of 92

*

56

開啟Spyder IDE 介面

57 of 92

*

57

##1-1.and or 運算子

a,b,c=5,10,6

result 1= a>b and b>c #and運算

result 2= a<b or c!=a #or運算

print(result1) ; print(result2) #輸出結果

0

1

1-1.py 邏輯運算子

58 of 92

*

58

##1-2.py

if score >=60:

print(“Pass”) # if 的語法需要將程序往後空格

else:

print(“Fail”)

輸入87 輸入49

Pass Fail

1-2.py if結構

59 of 92

*

59

##1-3.py

total=0

for count in range(1,101):

total+=count

print(“1加到100=”,total)

5050

 

60 of 92

*

60

##1-4.py

total=0

for count in range(1,100,2):

total+=count

print(“1~100奇數和=”,total)

2500

 

61 of 92

*

61

##1-5.py

x,y=1,10

while x<y:

x+=1

print(x)

10

1-5.py while迴圈

62 of 92

*

62

##1-6.py

total=0

for i in range(1,201,2):

if i==101:

break # 跳脫迴圈

total+=i

print(“1~100奇數和”,total)

2500

1-6.py break指令

63 of 92

*

63

##1-7.py

for x in range(1,10):

if x==5:

continue # 跳脫本輪迴圈

print(x,end=“ “)

1 2 3 4 6 7 8 9

1-7.py continue指令

64 of 92

*

64

##1-8.py

List1=[“A”,”B”,”C”,”D”,”E”]

for i in range(len(List1)):

print(List1[i])

A B C D E

1-8.py list結構

65 of 92

*

65

##1-9.py

a=[3,8,4] ) # a=[ ] 陣列

print(max(a)) # 印出最大

a.sort() # 排序

print(a) # 印出a

8

[3, 4, 8]

1-9.py 挑最大數字

66 of 92

*

66

##1-1.py

a=[3,8,4] ) # a=[ ] 陣列

print(min(a)) # 印出最小

a.sort() # 排序

print(a) # 印出a

3

[3, 4, 8]

1-10.py 挑最小數字

67 of 92

*

67

##1-11.py

word1=“zoo”

word2=“animal”

print(“交換前:”,word1,word2)

word2,word1 = word1,word2 #Unpacking

print(“交換後:”,word1,word2)

交換前:zoo animal

交換後:animal zoo

1-11.py Unpacking

68 of 92

*

68

##1-12.py

def func(a,b,c)

x=a+b+c

print(x)

print(func(1,2,3))

6

None

1-12.py 函數

69 of 92

*

69

##1-13.py

L1=[1,3,5,7]

T1=tuple(L1)

print(T1)

(1,3,5,7) # 注意:小括號表示型態為元組

1-13.py 元組

70 of 92

*

70

##1-14.py

Index=“Hello Python, This is Program”

print(“Index字串:”,Index)

print(Index[-3,-25,-2])

Index字串: Hello Python, This is Program

roPs iT,otP

1-14.py 切割字串

71 of 92

*

71

##1-15.py

def Pow(x,y):

p=1;

for i in range(y+1):

p*=x

return P

x,y=2,10

print(pow(x,y))

1-15.py 建立函式,解2的10次方

1024

72 of 92

*

72

第1個 Side Project:

數字辨識

mnist_using_keras .ipynb

73 of 92

*

73

感知器是甚麼?

Collaboratively administrate empowered markets via plug-and-play networks.

W1:權重(weight) / W2:權重

b: 偏權值 / O: 稱作『神經元』或『節點』

感知器式收到多個輸入號之後,再將訊號整合,在輸出一個訊號

O: 神經元

74 of 92

*

74

深度學習: 建立在多層感知器

猜數字AI訓練,學會參數是多少個

4. softmax

數值轉換成小數點,以機率表示

28x28=784

3. ReLU函數:

(activation function)

75 of 92

*

75

Step 1: import

載入數字資料集

76 of 92

*

76

Step2 : Plot number

77 of 92

*

77

Step3 : Scaling 0~1

78 of 92

*

78

Step4 : One-hot encoding

79 of 92

*

79

Step4 : Bulid model

80 of 92

*

80

Step4 : model Summary

參數 784X16 + 16 = 12560

數目 16X32 + 32 = 544

32X64 + 64 = 2112

64X10 + 10 = 650

ML DL 就是訓練參數,幾個參數至關重要

81 of 92

*

81

Step5 : model.fit

82 of 92

*

82

Step5 : 訓練結果

83 of 92

*

83

Step6 : 訓練好,做預測

84 of 92

*

84

Step 7: Loss function

85 of 92

*

85

Step 8: Accuracy

86 of 92

*

86

Step 9: Prediction

預測為7,成功辨識

87 of 92

*

87

結論

  • 您知道什麼是AI,機器學習,深度學習
  • 面對AI風潮,小朋友該如何自處
  • 利用網路資源,進入機器學習(Machine Learning),深度學習(Deep Learning)。
  • TensorFlow Playground是個好幫手
  • CNN,贏在起跑點。
  • 機器學習,深度學習可以做很多

88 of 92

*

88

下一周課程

1. 利用google Colab來學習,機器學習,深度學習

2. Anaconda 3 安裝

3. 簡易Python code 語法說明

4. 利用Python 實作 CNN卷積神經網路的深度學習。

5. 第一支自己的CNN Python code,贏在起跑點。

6. 如何深化自己在機器學習,深度學習的領域。

89 of 92

投稿2021工程、技術與STEM教育研討會榮獲刊登會議論文

90 of 92

*

90

巴斯光年隊,參加智泰AI圖像辯識競賽,榮獲全國高中職組冠軍,另外兩隊榮獲佳作,20210806

91 of 92

*

91

https://docs.google.com/forms/d/e/1FAIpQLSdKGc3V7kds6rHBrhd4xtS6kSWNw_9PJALOhlwV74_qUe7inQ/viewform?usp=sf_link

今天課程,滿意嗎?

請填問卷

92 of 92

*

92

Thanks for attention