Ejemplo n.º 1
0
def _perform_git_commit(filename, git_commit, git_message):
    if git_commit and git.is_git():
        reset('git')  # resets git commit info

        git.commit(git_message)
        log('Git repository identified. Performing git commit...')

        git_info = {
            'repository': git.get_remote(),
            'commit': git.get_current_commit(),
            'filename': filename,
            'path': git.get_relative_path(),
            'branch': git.get_branch()
        }
        log_git(git_info, verbose=False)
Ejemplo n.º 2
0
    def on_train_begin(self, n_epochs: int, metrics_names: list, **ka):
        if self.reset_tracking:
            reset('hyperparams', 'metrics')
        hyp_dict = {
            'epochs': n_epochs,
            'batch_size': self.learn.data.batch_size,
            'loss_func': str(self.learn.loss_func.func),
            'opt_func': str(self.learn.opt_func.func).split("'")[1],
            'weight_decay': self.learn.wd,
            'learning_rate': str(self.learn.opt.lr)
        }
        if self.arch_name:
            hyp_dict['arch_name'] = self.arch_name
        log_hyperparams(hyp_dict)

        if self.valid_set:
            self.met_names.extend(metrics_names)
Ejemplo n.º 3
0
    def on_train_begin(self, logs=None):
        # Reset state if required
        if self.reset_tracking:
            reset('hyperparams', 'metrics')

        hyp_dict = {
            'epochs': self.params['epochs'],
            'batch_size': self.params['batch_size'],
            'loss_func': self.model.loss,
            'opt':
            str(self.model.optimizer.__class__).split("'")[1].split('.')[-1],
            'wt_decay': self.model.optimizer.initial_decay,
            'lr': str(get_value(self.model.optimizer.lr))
        }
        if self.arch_name:
            hyp_dict['arch'] = self.arch_name
        log_hyperparams(hyp_dict, verbose=False)
        self.hyperparams = hyp_dict
Ejemplo n.º 4
0
 def test_reset_hyperparams(self):
     reset('hyperparams')
     expected_result = [('fake_slug_metrics_1', 'metrics', {}),
                        ('fake_slug_metrics_2', 'metrics', {})]
     self.assertEqual(jovian.utils.records._data_blocks, expected_result)
Ejemplo n.º 5
0
 def test_reset(self):
     reset()
     expected_result = []
     self.assertEqual(jovian.utils.records._data_blocks, expected_result)
Ejemplo n.º 6
0
def test_reset_all():
    with fake_records():
        reset()
        assert jovian.utils.records._data_blocks == []
Ejemplo n.º 7
0
def test_reset(metric_type, expected_result):
    with fake_records():
        reset(*metric_type)
        assert jovian.utils.records._data_blocks == expected_result