Код: Выделить всё
(X_train, y_train), (X_test, y_test) = keras.datasets.mnist.load_data()
Код: Выделить всё
model = keras.Sequential([
keras.layers.Dense(10, input_shape=(784,), activation='sigmoid')
])
model.compile(
optimizer='adam',
loss = 'sparse_categorical_crossentropy',
metrics = ['accuracy']
)
model.fit(X_train_flattened, y_train, epochs=5)
Подробнее здесь: https://stackoverflow.com/questions/791 ... -model-fit
Мобильная версия