s
This commit is contained in:
parent
58422eee10
commit
ba6e518100
3
train.py
3
train.py
@ -57,8 +57,9 @@ def train_model(data_file, model_file, epochs, batch_size, test_size, random_sta
|
|||||||
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
|
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
|
||||||
|
|
||||||
model.fit(X_train, y_train, epochs=epochs, batch_size=batch_size)
|
model.fit(X_train, y_train, epochs=epochs, batch_size=batch_size)
|
||||||
accuracy = model.evaluate(X_test, y_test)
|
loss, accuracy = model.evaluate(X_test, y_test)
|
||||||
print('Test accuracy:', accuracy)
|
print('Test accuracy:', accuracy)
|
||||||
|
print('Test loss:', loss)
|
||||||
|
|
||||||
model.save(model_file)
|
model.save(model_file)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user