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

Function get_param

locationencoder/locationencoder.py:64–69  ·  view source on GitHub ↗

Convenience function that indexes the hyperparameter dict but returns a default value if not defined rather than an error

(hparams, key, default=False)

Source from the content-addressed store, hash-verified

62 raise ValueError(f"{name} not a known neural networks.")
63
64def get_param(hparams, key, default=False):
65 """
66 Convenience function that indexes the hyperparameter dict but returns a default value if not defined rather than
67 an error
68 """
69 return hparams[key] if key in hparams.keys() else default
70
71# define the LightningModule
72class LocationEncoder(pl.LightningModule):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected