Are my training and validation code (tensorflow) right and does the model overfit?

后端 未结 1 1532
时光说笑
时光说笑 2021-01-29 12:30

This is my code:

for it in range(EPOCH*24410//BATCH_SIZE):
    tr_pa, tr_sp = sess.run([tr_para, tr_spec])
    train_loss, _ = sess.run([loss, fw_op], feed_dict=         


        
相关标签:
1条回答
  • 2021-01-29 12:46

    The telltale signature of overfitting is when your validation loss starts increasing, while your training loss continues decreasing, i.e.:

    (Image adapted from Wikipedia entry on overfitting)

    Here are some other plots indicating overfitting (source):

    See also the SO thread How to know if underfitting or overfitting is occuring?.

    Clearly, your plot does not exhibit such behavior, hence you are not overfitting.

    Your code looks OK, keeping in mind that you don't show what exactly goes on inside your session sess.

    0 讨论(0)
提交回复
热议问题