MACHINE | DEEP LEARNING/Deep Learning Project
[AI] 딥러닝 epochs history 모델의 훈련 과정 시각화 _차트
처카푸
2024. 4. 17. 23:09
epoch_history
: 객체에 저장된 통계치를 사용해 모델의 훈련 과정을 시각화할 수 있다
# 학습시킬때 변수에 저장하여 학습시킨다
epochs_history = model.fit(X_train, y_train, batch_size= 10, epochs= 100)
# 저장된 변수의 히스토리는 딕트로 나온다
epochs_history.history
import matplotlib.pyplot as plt
# 차트로 나타내기 (위에서 확인한 history의 키값 입력)
plt.plot(np.arange(1, 100+1), epochs_history.history['loss'])
plt.xlabel('# epochs')
plt.ylabel('Loss')
plt.show()