Skip to content

Add probabilistic modeling API with model factory and runner #11

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

Merged
merged 14 commits into from
Jun 12, 2025

Conversation

Leguark
Copy link
Member

@Leguark Leguark commented May 27, 2025

Probabilistic Modeling Framework for GemPy

This PR introduces a comprehensive framework for probabilistic modeling in GemPy, making it easier to define, run, and analyze probabilistic geological models.

Key Features

  • Added a factory function make_gempy_pyro_model to create Pyro models for GemPy with clean separation of concerns
  • Introduced GemPyPyroModel type alias for better type clarity throughout the codebase
  • Created standardized API for running probabilistic models with run_predictive, run_nuts_inference, and run_mcmc_for_NUTS
  • Implemented a configurable NUTS sampler with NUTSConfig dataclass
  • Reorganized likelihood functions into a more modular structure
  • Added comprehensive documentation for model creation and usage

Implementation Details

  • Moved backend configuration to run_gempy_forward for consistent execution
  • Refactored likelihood modules for better organization and reusability
  • Added utility functions for common probabilistic modeling tasks
  • Created test cases demonstrating the new framework's capabilities
  • Removed outdated gravity inversion example in favor of the new approach

This PR lays the groundwork for more sophisticated probabilistic modeling in GemPy, making it easier for users to define custom models while maintaining a clean separation between model definition, execution, and analysis.

@Leguark Leguark marked this pull request as ready for review June 12, 2025 08:15
@Leguark Leguark changed the title file Add probabilistic modeling API with model factory and runner Jun 12, 2025
Copy link
Member Author

Leguark commented Jun 12, 2025

Merge activity

  • Jun 12, 8:22 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 12, 8:44 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 12, 8:46 AM UTC: @Leguark merged this pull request with Graphite.

@Leguark Leguark changed the base branch from sort_likelihoods_for_gravity to graphite-base/11 June 12, 2025 08:41
@Leguark Leguark changed the base branch from graphite-base/11 to main June 12, 2025 08:43
Leguark added 14 commits June 12, 2025 08:44
Relocated `change_backend_gempy` call to `run_gempy_forward` to ensure proper backend configuration during execution. Removed redundant imports to clean up the module.
Refactored the code to define and utilize the `GemPyPyroModel` type alias for improved type clarity across the codebase. Updated method signatures and relevant imports to align with the new type definition.
Introduces `run_predictive` in the API for running predictive sampling. Refactored existing code in `test_prob_factory` to use the new utility, enhancing modularity and reducing redundancy.
@Leguark Leguark force-pushed the prob_model_factory branch from 32e5a0d to 619caaf Compare June 12, 2025 08:44
@Leguark Leguark merged commit 7517f62 into main Jun 12, 2025
1 check passed
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.

1 participant