-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdev and mean hot fix #177
Conversation
@@ -870,6 +872,9 @@ def get_loss_fun(loss): | |||
"MeanSquaredError" is requested, this will return | |||
an instance of tf.keras.losses.MeanSquaredError() | |||
""" | |||
kwargs = {} | |||
if isinstance(loss, dict): | |||
loss, kwargs = next(iter(loss.items())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a cool way to split a dict key/value! Does it crap out if there are multiple entries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this was based on a helpful hint from ruff. Itll only return the first key/value even if there are multiple entries.
data as low res (usually ERA5)""" | ||
data as low res (usually ERA5) | ||
|
||
NOTE: When initializing the lr_handler it's important to pick a shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, i'd like to see us add more of these "gotchas" directly to the docstrings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed!
stdev and mean hot fix
Previously computation of multi handler mean and stdev implicitly assumed each handler had roughly the same number of elements. Changed this to include handler weights.