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

Function overwrite_hparams_with_args

experiments/exp_era5.py:27–41  ·  view source on GitHub ↗
(hparams, args)

Source from the content-addressed store, hash-verified

25torch.set_float32_matmul_precision('medium')
26
27def overwrite_hparams_with_args(hparams, args):
28 # overwrites some hparams if specified in arguments
29 if "legendre_polys" in hparams.keys() and args.legendre_polys is not None:
30 hparams["legendre_polys"] = args.legendre_polys
31 print(f"using legendre-polys={args.legendre_polys}, as specified in args")
32 if "min_radius" in hparams.keys() and args.min_radius is not None:
33 hparams["min_radius"] = args.min_radius
34 print(f"using min-radius={args.min_radius}, as specified in args")
35 if args.harmonics_calculation is not None:
36 hparams["harmonics_calculation"] = args.harmonics_calculation
37 print(f"using harmonics_calculation={args.harmonics_calculation}, as specified in args")
38 if args.max_epochs is not None:
39 hparams["max_epochs"] = args.max_epochs
40 print(f"using max_epochs={args.max_epochs}, as specified in args")
41 return hparams
42
43def parse_args():
44 parser = argparse.ArgumentParser()

Callers 1

fitFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected