Skip to content
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

Numpyro sampler option, documentation, land/sea map fix, save trace fix #101

Merged
merged 35 commits into from
May 3, 2024

Conversation

brendan-m-murphy
Copy link
Contributor

@brendan-m-murphy brendan-m-murphy commented Apr 16, 2024

This branch adds the option to use Numpyro's NUTS sampler in place of the pymc NUTS sampler. This seems to be 7-10x faster. This addresses issue #17 and the ACRG project issue #30, although profiling needs to be done to assess the speed improvements.

It also adds some documentation by expanding the readme file and adding a short overview (https://github.com/openghg/openghg_inversions/tree/numpyro-fixed-outer-regions)

There are fixes to two other issues as well:

Also, a link to the DOI associated with releases was added to the readme file, and a test was added for the bucket/weighted basis function.

@brendan-m-murphy brendan-m-murphy changed the title Numpyro fixed outer regions Numpyro sampler option Apr 16, 2024
@brendan-m-murphy brendan-m-murphy changed the title Numpyro sampler option Numpyro sampler option, documentation, land/sea map fix, save trace fix Apr 18, 2024
This name can be passed to `fixedbasisMCMC`, and then passed on
to `data_processing_surface_notracer`, or it will be created based
on the formula in `get_data.py`
- `skip_postprocess` will be used for profiling runs
- `merged_data_only` can be used to merge data ahead of time;
  this will also be used for profiling performance
@brendan-m-murphy brendan-m-murphy marked this pull request as ready for review April 26, 2024 09:35
PBLH is being replaced by atmosphere_boundary_layer_thickness
in OpenGHG v0.8.

Also, the new merged data just stores "inlet", whereas old merged data
also stored "inlet_height_magl" and "height".
`min_model_error` was also added to the attributes of the output
dataset, so that the calculated value can be recovered.

The `residual_error_method` function should probably be moved from
`hbmcmc.py` once there is a location for other preprocessing functions.
Any NaNs after this point will cause errors in pymc.
@brendan-m-murphy
Copy link
Contributor Author

@joe-pitt reports: error using weighted basis with fixed outer regions:

[Yesterday 21:23] Joe Pitt
File "/user/home/zh21490/openghg_inversions/openghg_inversions/basis/_functions.py", line 201, in fixed_outer_regions_basis

basis.loc[loc_dict] = (inner_region + 5).squeeze().values

[Yesterday 21:24] Joe Pitt
ValueError: could not broadcast input array from shape (183,128) into shape (182,127)

Copy link
Contributor

@joe-pitt joe-pitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out the error Brendan mentioned only occurs for a certain flux file (or potentially a certain type of flux file), and it is actually giving the same behaviour on devel as on this branch. So it isn't an issue with these changes. I have successfully run a test ch4 inversion on this branch so I'm going to approve the PR.

@joe-pitt joe-pitt merged commit dcf5763 into devel May 3, 2024
3 checks passed
@joe-pitt joe-pitt deleted the numpyro-fixed-outer-regions branch May 3, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants