Условие:
def plot_learning_curves(history, title):
plt.plot(history.history['loss'], label='train')
plt.plot(history.history['val_loss'], label='val')
plt.title(title)
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.legend()
plt.grid(True)
plt.show()
\nplot_learning_curves(history_rnn, "RNN Learning Curves")\nplot_learning_curves(history_lstm, "LSTM Learning Curves")
![def plotlearningcurves(history, title): plt.plot(history.history['loss'], label='train') plt.plot(history.history['val_loss'], label='val') plt.title(title) plt.xlabel('Epochs') plt.ylabel('Loss') plt.legend() plt.grid(True) plt.show()](/public/images/library/external/library-detail-hero-book.png)
