print(minist_model.history) Loss = minist_model.history['loss']val_loss = minist_model.history['val_loss'] accuracy = minist_model.historyl'accuracy']val_accuracy = minist_model.history['val_accuracy']print(loss) def draw_loss(loss, al_loss):
时间: 2024-02-06 11:09:42 浏览: 92
minist_test.csv 和minist_train.csv和minist_train_100.csv和minist_te
To draw the loss curve, you can use the matplotlib library in Python. Here's an example code snippet:
```
import matplotlib.pyplot as plt
def draw_loss(loss, val_loss):
epochs = range(1, len(loss) + 1)
plt.plot(epochs, loss, 'bo', label='Training loss')
plt.plot(epochs, val_loss, 'b', label='Validation loss')
plt.title('Training and validation loss')
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.legend()
plt.show()
```
You can then call this function with your `loss` and `val_loss` arrays to visualize the loss curve. For example:
```
draw_loss(loss, val_loss)
```
This will show a plot with the training loss and validation loss for each epoch.
阅读全文