def get_loggers(self): loggers = {} labels = ['input', 'output', 'attn'] for key in labels: loggers[key] = LazyRegisterer( os.path.join(self.logs_folder, '{}_{}.png'.format(key, self.split)), 'image', 'Samples {} {}'.format(key, self.split)) return loggers
def get_loggers(self, add_orientation, split): loggers = {} labels = ['input', 'gt_segmentation', 'output_segmentation'] if add_orientation: labels.extend(['gt_orientation', 'output_orientation']) for name in labels: key = '{}_{}'.format(name, split) loggers[name] = LazyRegisterer( os.path.join(self.logs_folder, '{}.png'.format(key)), 'image', 'Samples {} {}'.format(name, split)) return loggers
def _get_plot_loggers(model_opt, train_opt): samples = {} _ssets = ['train', 'valid'] for _set in _ssets: labels = ['input', 'output'] for name in labels: key = '{}_{}'.format(name, _set) samples[key] = LazyRegisterer( os.path.join(logs_folder, '{}.png'.format(key)), 'image', 'Samples {} {}'.format(name, _set)) return samples
def get_loggers(self): loggers = {} labels = ['input', 'output', 'total', 'box', 'patch', 'attn'] if self.model_opt['add_d_out']: labels.append('d_in') if self.model_opt['add_y_out']: labels.append('y_in') for key in labels: loggers[key] = LazyRegisterer( os.path.join(self.logs_folder, '{}_{}.png'.format(key, self.split)), 'image', 'Samples {} {}'.format(key, self.split)) return loggers
def get_plot_loggers(model_opt, train_opt): samples = {} _ssets = ['train', 'valid'] for _set in _ssets: labels = ['input', 'output'] if model_opt['ctrl_rnn_inp_struct'] == 'attn': labels.append('attn') for name in labels: key = '{}_{}'.format(name, _set) samples[key] = LazyRegisterer( os.path.join(logs_folder, '{}.png'.format(key)), 'image', 'Samples {} {}'.format(name, _set)) return samples
def get_plot_loggers(model_opt, train_opt): samples = {} _ssets = ['train'] if train_opt['has_valid']: _ssets.append('valid') for _set in _ssets: labels = ['input', 'output', 'total'] if model_opt['type'] == 'attention': num_ctrl_cnn = len(model_opt['ctrl_cnn_filter_size']) num_attn_cnn = len(model_opt['attn_cnn_filter_size']) num_attn_dcnn = len(model_opt['attn_dcnn_filter_size']) labels.extend(['box', 'patch']) if model_opt['ctrl_rnn_inp_struct'] == 'attn': labels.append('attn') for name in labels: key = '{}_{}'.format(name, _set) samples[key] = LazyRegisterer( os.path.join(logs_folder, '{}.png'.format(key)), 'image', 'Samples {} {}'.format(name, _set)) return samples
'train batch mean', 'valid batch mean', 'train batch variance', 'valid batch variance', 'ema mean', 'ema variance' ], name='D-CNN {} batch norm stats'.format(ii), buffer_size=1) dcnn_bn_loggers.append(_dcnn_bn_logger) log_manager.register(log.filename, 'plain', 'Raw logs') model_opt_fname = os.path.join(logs_folder, 'model_opt.yaml') saver.save_opt(model_opt_fname, model_opt) log_manager.register(model_opt_fname, 'plain', 'Model hyperparameters') valid_sample_img = LazyRegisterer( os.path.join(logs_folder, 'valid_sample_img.png'), 'image', 'Validation samples') train_sample_img = LazyRegisterer( os.path.join(logs_folder, 'train_sample_img.png'), 'image', 'Training samples') log.info( ('Visualization can be viewed at: ' 'http://{}/deep-dashboard?id={}').format(args.localhost, model_id)) num_ex_train = dataset['train']['input'].shape[0] num_ex_valid = dataset['valid']['input'].shape[0] get_batch_train = _get_batch_fn(dataset['train']) get_batch_valid = _get_batch_fn(dataset['valid']) batch_size = args.batch_size log.info('Number of validation examples: {}'.format(num_ex_valid))