Convenience function that indexes the hyperparameter dict but returns a default value if not defined rather than an error
(hparams, key, default=False)
| 62 | raise ValueError(f"{name} not a known neural networks.") |
| 63 | |
| 64 | def 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 |
| 72 | class LocationEncoder(pl.LightningModule): |