最初のニューラルネットワーク

Kerasで学ぶIntroduction to Deep Learning

Miguel Esteban

Data Scientist & Founder

ニューラルネットワークとは

Kerasで学ぶIntroduction to Deep Learning

パラメータ

Kerasで学ぶIntroduction to Deep Learning

勾配降下法

Kerasで学ぶIntroduction to Deep Learning

Sequential API

Kerasで学ぶIntroduction to Deep Learning

Sequential API

Kerasで学ぶIntroduction to Deep Learning

Sequential API

Kerasで学ぶIntroduction to Deep Learning

ニューラルネットワークの定義

from tensorflow.keras.models import Sequential

from tensorflow.keras.layers import Dense
# Create a new sequential model model = Sequential()
# Add and input and dense layer model.add(Dense(2, input_shape=(3,)))
# Add a final 1 neuron layer model.add(Dense(1))

Kerasで学ぶIntroduction to Deep Learning

活性化関数を追加

from tensorflow.keras.models import Sequential

from tensorflow.keras.layers import Dense
# Create a new sequential model model = Sequential()
# Add and input and dense layer model.add(Dense(2, input_shape=(3,)))
# Add a final 1 neuron layer model.add(Dense(1))

Kerasで学ぶIntroduction to Deep Learning

活性化関数を追加

from tensorflow.keras.models import Sequential

from tensorflow.keras.layers import Dense
# Create a new sequential model model = Sequential()
# Add and input and dense layer model.add(Dense(2, input_shape=(3,), activation="relu"))
# Add a final 1 neuron layer model.add(Dense(1))

Kerasで学ぶIntroduction to Deep Learning

モデルを要約表示

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で学ぶIntroduction to Deep Learning

パラメータを可視化

Kerasで学ぶIntroduction to Deep Learning

パラメータを可視化

Kerasで学ぶIntroduction to Deep Learning

モデルを要約表示

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で学ぶIntroduction to Deep Learning

Let's code!

Kerasで学ぶIntroduction to Deep Learning

Preparing Video For Download...