你的第一個神經網路

Keras 深度學習入門

Miguel Esteban

Data Scientist & Founder

什麼是神經網路?

Keras 深度學習入門

參數

Keras 深度學習入門

梯度下降

Keras 深度學習入門

Sequential API

Keras 深度學習入門

Sequential API

Keras 深度學習入門

Sequential API

Keras 深度學習入門

定義神經網路

from tensorflow.keras.models import Sequential

from tensorflow.keras.layers import Dense
# 建立新的順序式模型 model = Sequential()
# 加入輸入層與全連接層 model.add(Dense(2, input_shape=(3,)))
# 加入最後 1 個神經元的層 model.add(Dense(1))

Keras 深度學習入門

加入啟用函式

from tensorflow.keras.models import Sequential

from tensorflow.keras.layers import Dense
# 建立新的順序式模型 model = Sequential()
# 加入輸入層與全連接層 model.add(Dense(2, input_shape=(3,)))
# 加入最後 1 個神經元的層 model.add(Dense(1))

Keras 深度學習入門

加入啟用函式

from tensorflow.keras.models import Sequential

from tensorflow.keras.layers import Dense
# 建立新的順序式模型 model = Sequential()
# 加入輸入層與全連接層 model.add(Dense(2, input_shape=(3,), activation="relu"))
# 加入最後 1 個神經元的層 model.add(Dense(1))

Keras 深度學習入門

摘要你的模型

model.summary()
Layer (type)                 Output Shape              Param #   
=================================================================
dense_3 (Dense)              (None, 2)                 8         
_________________________________________________________________
dense_4 (Dense)              (None, 1)                 3         
=================================================================
Total params: 11
Trainable params: 11
Non-trainable params: 0
_________________________________________________________________
Keras 深度學習入門

視覺化參數

Keras 深度學習入門

視覺化參數

Keras 深度學習入門

摘要你的模型

model.summary()
Layer (type)                 Output Shape              Param #   
=================================================================
dense_3 (Dense)              (None, 2)             --> 8 <--       
_________________________________________________________________
dense_4 (Dense)              (None, 1)                 3         
=================================================================
Total params: 11
Trainable params: 11
Non-trainable params: 0
_________________________________________________________________
Keras 深度學習入門

開始寫程式!

Keras 深度學習入門

Preparing Video For Download...