DECA icon indicating copy to clipboard operation
DECA copied to clipboard

How do you know the model has converged?

Open bxiong97 opened this issue 2 years ago • 3 comments

Hi, thank you for releasing the code! I have some questions about the training process:

  1. How long do you train the model for? From the configs it seems that you train for 1~2 epochs in total, but how is this number decided?
  2. How do you know it has converged? By converge I mean the validation loss is at its lowest point.
  3. How do you know the model is not overfitting or underfitting?
  4. What is the validation loss function? Is it the same as the training loss function?

Thank you for your time!

bxiong97 avatar Feb 12 '23 08:02 bxiong97

In the validation step, all the code does is visualizing the results. How do we know quantitatively that the model is improving?

def validation_step(self):
    self.deca.eval()
    try:
        batch = next(self.val_iter)
    except:
        self.val_iter = iter(self.val_dataloader)
        batch = next(self.val_iter)
    images = batch['image'].cuda(); images = images.view(-1, images.shape[-3], images.shape[-2], images.shape[-1]) 
    with torch.no_grad():
        codedict = self.deca.encode(images)
        opdict, visdict = self.deca.decode(codedict)
    savepath = os.path.join(self.cfg.output_dir, self.cfg.train.val_vis_dir, f'{self.global_step:08}.jpg')
    util.visualize_grid(visdict, savepath)

bxiong97 avatar Feb 13 '23 10:02 bxiong97

Were you able to train DECA?

emlcpfx avatar Aug 17 '23 09:08 emlcpfx