Skip to content

Conversation

@amirxdbx
Copy link

This PR adds a new machine-learning-based Ground Motion Model for Turkey
(Mohammadi et al., 2023) implemented as a GSIM in the OpenQuake hazard library.

Key features:
• Implements the vectorized compute() API (no legacy methods).
• Wraps the official XGBoost models exported to ONNX runtime.
• Includes standard deviations (sigma, tau, phi) from stds.csv.
• Includes verification tables and regression tests.
• Documentation updated in hazardlib.gsim.rst.
• Changelog updated.

The GSIM-specific tests pass successfully.

@CB-quakemodel
Copy link
Contributor

Dear Amir,

Many thanks for providing an implementation of your machine-learning based GSIM. I will do my best to review this model by the end of the month.

One thing I notice immediately, is that there are far too many .onnx files added in the current approach. You need to adjust the implementation to store the cached ONNX sessions for each intensity measure within a single file (1 per period is simply too many). Making this change would be much appreciated on our end.

Perhaps @micheles can give some input on this too.

Thanks,

Christopher

@amirxdbx amirxdbx closed this Jan 3, 2026
@amirxdbx amirxdbx reopened this Jan 3, 2026
@amirxdbx
Copy link
Author

amirxdbx commented Jan 3, 2026

Dear Christopher (@CB-quakemodel),

Happy New Year, and I apologise for the raised issue.
I have bundled all the ONNX files into one and modified the code accordingly. Please check if any other steps are required from my end.

Bests
Amir

@CB-quakemodel
Copy link
Contributor

Dear Christopher (@CB-quakemodel),

Happy New Year, and I apologise for the raised issue. I have bundled all the ONNX files into one and modified the code accordingly. Please check if any other steps are required from my end.

Bests Amir

Dear @amirxdbx,

Thanks for making the changes, and a happy new year to yourself also.

I see many ONNX files are now included in a different location and were not included in the initial commits you made earlier today, so perhaps these are unintentionally remaining in your PR? Also, the workflow_failure.yaml has been modified in your PR, so you should revert this file given it is likely unintentionally modified here.

Thanks,

Christopher

@amirxdbx
Copy link
Author

amirxdbx commented Jan 3, 2026

Dear Christopher,
Thanks for pointing this out. I removed the extra files and reverted the changes to the yaml file.
Bests
Amir

@CB-quakemodel
Copy link
Contributor

Dear Christopher, Thanks for pointing this out. I removed the extra files and reverted the changes to the yaml file. Bests Amir

Many thanks! I will complete my review early this week.

Copy link
Contributor

@CB-quakemodel CB-quakemodel left a comment

Choose a reason for hiding this comment

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

Thanks again @amirxdbx, I have made an initial review with only a handful of comments/requested changes (nearly all of them are just to make things cleaner/easier to digest as an external user reviewing the GSIM module). The only moderately big change is to ensure safe handling of any external files used in the GSIM (please see my comments within the review).

Please note that the docs tests are failing primarily due to the formatting changes I suggest in my review - please see here for more info on the required formatting changes too.

@amirxdbx
Copy link
Author

amirxdbx commented Jan 3, 2026

Thanks for the review, Christopher! I’ve updated the code to address your comments.

I moved the documentation into the class strings and added the init method to handle the CSV loading safely as you suggested. I also cleaned up the global variables, fixed the spacing, and consolidated those checks.

Let me know if everything looks good now!

@amirxdbx
Copy link
Author

amirxdbx commented Jan 3, 2026

Dear @CB-quakemodel, Thanks again for guiding me on the path. I have addressed your previous comments. I hope this fixes all the fails.

Bests
Amir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants