MCPcopy Create free account
hub / github.com/MarcCoru/locationencoder / fit_models

Function fit_models

experiments/exp_quantitative.py:103–139  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

101
102
103def fit_models(args):
104 dataset = args.dataset
105 # ["spherec", "spherecplus", "wrap", "sphericalharmonics", "theory", "grid", "direct", "cartesian3d"]
106 # ["linear", "siren", "fcnet", "mlp"]
107
108 if not isinstance(args.pe, list):
109 args.pe = list(args.pe)
110
111 if not isinstance(args.nn, list):
112 args.nn = list(args.nn)
113
114 for pe in args.pe:
115 for nn in args.nn: #
116 for seed in np.arange(args.num_seeds):
117 args_fit = Namespace(dataset=dataset,
118 pe=pe,
119 nn=nn,
120 save_model=True if dataset == "inat2018" else False, # inat needs checkpoints for evaluation
121 log_wandb=False,
122 hparams='hparams.yaml',
123 results_dir='results/train',
124 expname=f'exp_quantiative/{seed}',
125 legendre_polys=None, # take from hparams file
126 seed=seed,
127 harmonics_calculation="analytic",
128 resume_ckpt_from_results_dir=args.resume_ckpt_from_results_dir,
129 gpus=args.gpus,
130 use_expnamehps=False,
131 matplotlib=False,
132 matplotlib_show=False,
133 accelerator=args.accelerator,
134 checkerboard_scale=1,
135 max_epochs=None,
136 min_radius=None) # take from hparams file
137
138 fit(args_fit)
139 return args
140
141if __name__ == '__main__':
142 main()

Callers 1

mainFunction · 0.70

Calls 1

fitFunction · 0.90

Tested by

no test coverage detected