Багатокласова класифікація

Вступ до Deep Learning з Keras

Miguel Esteban

Data Scientist & Founder

Кидання дротиків

Вступ до Deep Learning з Keras

Набір даних

Вступ до Deep Learning з Keras

Набір даних

Вступ до Deep Learning з Keras

Архітектура

Вступ до Deep Learning з Keras

Архітектура

Вступ до Deep Learning з Keras

Архітектура

Вступ до Deep Learning з Keras

Вихідний шар

Вступ до Deep Learning з Keras

Багатокласова модель

# Instantiate a sequential model
# ...

# Add an input and hidden layer # ...
# Add more hidden layers # ...
# Add your output layer model.add(Dense(4, activation='softmax')
Вступ до Deep Learning з Keras

Категорійна крос-ентропія

model.compile(optimizer='adam', loss='categorical_crossentropy')

Вступ до Deep Learning з Keras

Підготовка набору даних

import pandas as pd
from tensorflow.keras.utils import to_categorical

# Load dataset
df = pd.read_csv('data.csv')

# Turn response variable into labeled codes df.response = pd.Categorical(df.response) df.response = df.response.cat.codes
# Turn response variable into one-hot response vector y = to_categorical(df.response)
Вступ до Deep Learning з Keras

One-hot кодування

Вступ до Deep Learning з Keras

Давайте потренуємось!

Вступ до Deep Learning з Keras

Preparing Video For Download...