MCPcopy Create free account
hub / github.com/DragonisCV/RAM / validation

Method validation

ram/models/base_model.py:36–48  ·  view source on GitHub ↗

Validation function. Args: dataloader (torch.utils.data.DataLoader): Validation dataloader. current_iter (int): Current iteration. tb_logger (tensorboard logger): Tensorboard logger. save_img (bool): Whether to save images. Default: False.

(self, dataloader, current_iter, tb_logger, save_img=False,test_num=-1,save_num=-1)

Source from the content-addressed store, hash-verified

34 pass
35
36 def validation(self, dataloader, current_iter, tb_logger, save_img=False,test_num=-1,save_num=-1):
37 """Validation function.
38
39 Args:
40 dataloader (torch.utils.data.DataLoader): Validation dataloader.
41 current_iter (int): Current iteration.
42 tb_logger (tensorboard logger): Tensorboard logger.
43 save_img (bool): Whether to save images. Default: False.
44 """
45 if self.opt['dist']:
46 self.dist_validation(dataloader, current_iter, tb_logger, save_img,test_num,save_num)
47 else:
48 self.nondist_validation(dataloader, current_iter, tb_logger, save_img,test_num,save_num)
49
50 def _initialize_best_metric_results(self, dataset_name):
51 """Initialize the best metric results dict for recording the best metric value and iteration."""

Callers 2

train_pipelineFunction · 0.80
test_pipelineFunction · 0.80

Calls 2

dist_validationMethod · 0.45
nondist_validationMethod · 0.45

Tested by 1

test_pipelineFunction · 0.64