隕石衝突を生き延びる

Kerasで学ぶIntroduction to Deep Learning

Miguel Esteban

Data Scientist & Founder

おさらい

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

コンパイル

# Compiling your previously built model
model.compile(optimizer="adam", loss="mse")

Kerasで学ぶIntroduction to Deep Learning

学習

# Train your model
model.fit(X_train, y_train, epochs=5)
Epoch 1/5
1000/1000 [==============================] - 0s 242us/step - loss: 0.4090
Epoch 2/5
1000/1000 [==============================] - 0s 34us/step - loss: 0.3602
Epoch 3/5
1000/1000 [==============================] - 0s 37us/step - loss: 0.3223
Epoch 4/5
1000/1000 [==============================] - 0s 34us/step - loss: 0.2958
Epoch 5/5
1000/1000 [==============================] - 0s 33us/step - loss: 0.2795
Kerasで学ぶIntroduction to Deep Learning

予測

# Predict on new data
preds = model.predict(X_test)

# Look at the predictions
print(preds)
array([[0.6131608 ],
       [0.5175948 ],
       [0.60209155],
       ...,
       [0.55633   ],
       [0.5305591 ],
       [0.50682044]])
Kerasで学ぶIntroduction to Deep Learning

評価

# Evaluate your results
model.evaluate(X_test, y_test)
1000/1000 [==============================] - 0s 53us/step
0.25
Kerasで学ぶIntroduction to Deep Learning

取り組む問題

Kerasで学ぶIntroduction to Deep Learning

科学的予測

Kerasで学ぶIntroduction to Deep Learning

あなたの課題

Kerasで学ぶIntroduction to Deep Learning

地球を救おう!

Kerasで学ぶIntroduction to Deep Learning

Preparing Video For Download...