Skip to content

请问为什么要在训练代码中使用测试集选择最好的模型呢? #3

@LIKP0

Description

@LIKP0

您好!感谢您开源代码,这对我有很大帮助!

但是我对您train_brats.py中如下的代码有些疑惑:

for epoch_num in tqdm(range(max_epoch), ncols=70):
    time1 = time.time()
    for i_batch, (sampled_batch, sample_stats) in enumerate(trainloader):
        ........

   ## ================ Evaluate ================
    logging.info(f'Epoch {epoch_num} Evaluation:')
    # print()
    t1_MSE_all, t1_PSNR_all, t1_SSIM_all = [], [], []
    t2_MSE_all, t2_PSNR_all, t2_SSIM_all = [], [], []
  
    t1_MSE_krecon, t1_PSNR_krecon, t1_SSIM_krecon = [], [], []
    t2_MSE_krecon, t2_PSNR_krecon, t2_SSIM_krecon = [], [], []
  
    for (sampled_batch, sample_stats) in testloader:
      ........

请问为什么要在训练代码中使用测试集选择best model呢?可能我的理解有误,但是我同样没有在训练代码中发现验证集?

再次感谢您的精彩工作,谢谢。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions