MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / create_base_config

Function create_base_config

scripts/config_generator.py:30–174  ·  view source on GitHub ↗
(alg, seed,
                       dataset, net, num_classes, num_labels,
                       port,
                       weight_decay,
                       depth, widen_factor,

                       )

Source from the content-addressed store, hash-verified

28
29
30def create_base_config(alg, seed,
31 dataset, net, num_classes, num_labels,
32 port,
33 weight_decay,
34 depth, widen_factor,
35
36 ):
37 cfg = {}
38
39 # save config
40 cfg['save_dir'] = './saved_models'
41 cfg['save_name'] = None
42 cfg['resume'] = False
43 cfg['load_path'] = None
44 cfg['overwrite'] = True
45 cfg['use_tensorboard'] = True
46
47 # algorithm config
48 cfg['epoch'] = 1
49 cfg['num_train_iter'] = 2 ** 20
50 cfg['num_eval_iter'] = 5000
51 cfg['num_labels'] = num_labels
52 cfg['batch_size'] = 64
53 cfg['eval_batch_size'] = 1024
54 if alg == 'fixmatch':
55 cfg['hard_label'] = True
56 cfg['T'] = 0.5
57 cfg['p_cutoff'] = 0.95
58 cfg['ulb_loss_ratio'] = 1.0
59 cfg['uratio'] = 7
60 elif alg == 'flexmatch':
61 cfg['hard_label'] = True
62 cfg['T'] = 0.5
63 cfg['p_cutoff'] = 0.95
64 cfg['ulb_loss_ratio'] = 1.0
65 cfg['uratio'] = 7
66 elif alg == 'uda':
67 cfg['TSA_schedule'] = 'none'
68 cfg['T'] = 0.4
69 cfg['p_cutoff'] = 0.8
70 cfg['ulb_loss_ratio'] = 1.0
71 cfg['uratio'] = 7
72 elif alg == 'pseudolabel':
73 cfg['ulb_loss_ratio'] = 1.0
74 cfg['uratio'] = 1
75 elif alg == 'mixmatch':
76 cfg['uratio'] = 1
77 cfg['alpha'] = 0.5
78 cfg['T'] = 0.5
79 cfg['ulb_loss_ratio'] = 100
80 cfg['ramp_up'] = 0.4
81 elif alg == 'remixmatch':
82 cfg['alpha'] = 0.75
83 cfg['T'] = 0.5
84 cfg['ulb_loss_ratio'] = 1.0
85 cfg['w_kl'] = 0.5
86 cfg['w_match'] = 1.5
87 cfg['w_rot'] = 0.5

Callers 2

exp_baselineFunction · 0.85
exp_flex_componentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected