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

Inherit benchmark simulators #180

Conversation

Chase-Grajeda
Copy link

@Chase-Grajeda Chase-Grajeda commented Jul 5, 2024

Updated existing benchmarks to be subclasses of Benchmark

Changes implemented:

  • Added new subclasses to benchmarks/__init__.py
  • Added prior and observation_model interfaces to benchmark.py
  • Changed sample in benchmark.py to now use batched_call on __call__
  • Added class BernoulliGLM to bernoulli_glm.py and vectorized covariance matrix
  • Added class BernoulliGLMRaw to bernoulli_glm_raw.py and vectorized covariance matrix
  • Added class GaussianLinear to gaussian_linear.py
  • Added class GaussianLinearUniform to gaussian_linear_uniform.py
  • Added class GaussianMixture to gaussian_mixture.py
  • Added class InverseKinematics to inverse_kinematics.py
  • Added class LotkaVolterra to lotka_volterra.py
  • Added class SIR to sir.py
  • Added class SLCP to slcp.py
  • Added class SLCPDistractors to slcp_distractors.py
  • Added class TwoMoons to two_moons.py

Implemented example for using an inherited simulator and adding OOP design to two_moons.py
@Chase-Grajeda Chase-Grajeda added the refactoring Some code shall be redesigned label Jul 5, 2024
@Chase-Grajeda Chase-Grajeda self-assigned this Jul 5, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 289 lines in your changes missing coverage. Please review.

Project coverage is 55.82%. Comparing base (3855cb2) to head (b2cdc00).
Report is 21 commits behind head on streamlined-backend.

Files Patch % Lines
bayesflow/benchmarks/slcp_distractors.py 0.00% 36 Missing ⚠️
bayesflow/benchmarks/sir.py 0.00% 33 Missing ⚠️
bayesflow/benchmarks/lotka_volterra.py 0.00% 32 Missing ⚠️
bayesflow/benchmarks/bernoulli_glm.py 0.00% 28 Missing ⚠️
bayesflow/benchmarks/slcp.py 0.00% 23 Missing ⚠️
bayesflow/benchmarks/bernoulli_glm_raw.py 0.00% 22 Missing ⚠️
bayesflow/benchmarks/inverse_kinematics.py 0.00% 22 Missing ⚠️
bayesflow/benchmarks/gaussian_mixture.py 0.00% 19 Missing ⚠️
bayesflow/benchmarks/gaussian_linear_uniform.py 0.00% 18 Missing ⚠️
bayesflow/benchmarks/gaussian_linear.py 0.00% 17 Missing ⚠️
... and 3 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                   Coverage Diff                   @@
##           streamlined-backend     #180      +/-   ##
=======================================================
- Coverage                57.34%   55.82%   -1.52%     
=======================================================
  Files                      104      105       +1     
  Lines                     2070     2198     +128     
=======================================================
+ Hits                      1187     1227      +40     
- Misses                     883      971      +88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Added class hierarchy to two_moons.py and lotka_volterra.py.
Updated __init__.py respectively.
Updated benchmark.py docstring
@stefanradev93
Copy link
Contributor

Looking good!

Added classes for remaining benchmarks.
Added new subclasses to __init__.py.
@Chase-Grajeda Chase-Grajeda marked this pull request as ready for review July 9, 2024 20:06
@stefanradev93 stefanradev93 merged commit 9c6216e into bayesflow-org:streamlined-backend Jul 10, 2024
3 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Some code shall be redesigned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants