{"id":41662806,"url":"https://github.com/suriyadeepan/pm-pyro","last_synced_at":"2026-01-24T17:12:19.231Z","repository":{"id":57453756,"uuid":"222211283","full_name":"suriyadeepan/pm-pyro","owner":"suriyadeepan","description":"PyMC3-like Interface for Pyro","archived":false,"fork":false,"pushed_at":"2019-12-01T02:50:55.000Z","size":1409,"stargazers_count":38,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T19:10:16.329Z","etag":null,"topics":["probabilistic-programming","pymc3","pyro"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suriyadeepan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-17T07:14:07.000Z","updated_at":"2025-08-04T20:34:25.000Z","dependencies_parsed_at":"2022-08-29T06:51:43.722Z","dependency_job_id":null,"html_url":"https://github.com/suriyadeepan/pm-pyro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suriyadeepan/pm-pyro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suriyadeepan%2Fpm-pyro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suriyadeepan%2Fpm-pyro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suriyadeepan%2Fpm-pyro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suriyadeepan%2Fpm-pyro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suriyadeepan","download_url":"https://codeload.github.com/suriyadeepan/pm-pyro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suriyadeepan%2Fpm-pyro/sbom","scorecard":{"id":860197,"data":{"date":"2025-08-11","repo":{"name":"github.com/suriyadeepan/pm-pyro","commit":"f25bb37dede6345541f7105b427396bcd59ad761"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3749-ghw9-m3mg","Warn: Project is vulnerable to: PYSEC-2022-43015 / GHSA-47fc-vmwq-366v","Warn: Project is vulnerable to: PYSEC-2025-41 / GHSA-53q9-r3pm-6pq6","Warn: Project is vulnerable to: PYSEC-2024-252 / GHSA-5pcm-hx3q-hm94","Warn: Project is vulnerable to: GHSA-887c-mr87-cxwp","Warn: Project is vulnerable to: PYSEC-2024-251 / GHSA-pg7h-5qx3-wjr3","Warn: Project is vulnerable to: PYSEC-2024-250","Warn: Project is vulnerable to: PYSEC-2024-259","Warn: Project is vulnerable to: PYSEC-2017-74"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T01:01:21.428Z","repository_id":57453756,"created_at":"2025-08-24T01:01:21.428Z","updated_at":"2025-08-24T01:01:21.428Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28732260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["probabilistic-programming","pymc3","pyro"],"created_at":"2026-01-24T17:12:18.608Z","updated_at":"2026-01-24T17:12:19.219Z","avatar_url":"https://github.com/suriyadeepan.png","language":"Jupyter Notebook","readme":"![](images/logo-medium.png)\n\nPyMC3-like abstractions for pyro's stochastic function.\nDefine a model as a stochastic function in pyro.\nUse `pm_like` wrapper to create a PyMC3-esque `Model`.\nRandom variables are exposed to user as attributes of `Model`.\npm-pyro provides abstractions for sampling-based inference methods (NUTS - The No-U-Turn Sampler, HMC - Hamiltonion Monte Carlo), as well as Variational Inference (SVI with autoguides), trace plots, posterior plot and posterior predictive plots.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/pmpyro-demo.gif\"\u003e\n\u003c/p\u003e\n\n## Install\n\nInstall from pypi\n\n```bash\npip install pm-pyro\n```\n\nDeveloper setup\n```bash\n# install requirements\npip install -r requirements-dev.txt\n# run tests\npython -m pytest pmpyro/tests.py\n```\n\n## Example\n\nBorrowed the example from a [PyMC3 tutorial](https://docs.pymc.io/notebooks/getting_started.html). The outcome variable `Y` is dependent on 2 features `X_1` and `X_2`. The notebook for this example is available [here](notebooks/motivating-example.ipynb)\n\n![](images/plot_data.png)\n\n\n## Model Specification\n\nWe design a simple Bayesian Linear Regression model.\n\n![](images/stfn.png)\n\n## Stochastic Function\n\nThe model specification is implemented as a stochastic function.\n\n\n```python\nimport pyro.distributions as dist\nimport pyro\nimport torch\n\ndef pyro_model(x1, x2, y):\n    alpha = pyro.sample('alpha', dist.Normal(0, 10))\n    beta = pyro.sample('beta',pdist.Normal(torch.zeros(2,), torch.ones(2,) * 10.))\n    sigma = pyro.sample('sigma', dist.HalfNormal(1.))\n\n    # Expected value of outcome\n    mu = alpha + beta[0] * x1 + beta[1] * x2\n\n    # Likelihood (sampling distribution) of observations\n    return pyro.sample('y_obs', dist.Normal(mu, sigma), obs=y)\n```\n\n## Context-manager Syntax\n\nThe `pm_like` wrapper creates a PyMC3-esque `Model`. \nWe can use the context manager syntax for running inference.\n`pm.sample` samples from the model using the NUTS sampler.\nThe trace is a python dictionary which contains the samples.\n\n```python\nfrom pmpyro import pm_like\nimport pmpyro as pm\n\nwith pm_like(pyro_model, X1, X2, Y) as model:\n    trace = pm.sample(1000)\n```\n\n```\nsample: 100%|██████████| 1300/1300 [00:16, 80.42it/s, step size=7.49e-01, acc. prob=0.911] \n```\n\n## Traceplot\n\nWe can visualize the samples using `traceplot`.\nSelect random variables by passing them as a list via `var_names = [ 'alpha' ... ]` argument.\n\n```python\npm.traceplot(trace)\n```\n\n![](images/traceplot.png)\n\n## Plot Posterior\n\nVisualize posterior of random variables using `plot_posterior`.\n\n```python\npm.plot_posterior(trace, var_names=['beta'])\n```\n\n![](images/posterior_plot.png)\n\n## Posterior Predictive Samples\n\nWe can sample from the posterior by running `plot_posterior_predictive` or `sample_posterior_predictive` with the same\nfunction signatures as the stochastic function `def pyro_model(x1, x2, y)`, replacing observed variable `Y` with `None`. \n\n```python\nppc = pm.plot_posterior_predictive(X1, X2, None,\n                          trace=trace, model=model, samples=60,\n                          alpha=0.08, obs={'y_obs' : Y})\n```\n\n![](images/ppc1.png)\n![](images/ppc2.png)\n\n\n## Trace Summary\n\nThe summary of random variables is available as a pandas array.\n\n```python\npm.summary()\n```\n\n![](images/trace_summary.png)\n\n\n## License\n\nThis project is licensed under the GPL v3 License - see the [LICENSE.md](LICENSE.md) file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuriyadeepan%2Fpm-pyro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuriyadeepan%2Fpm-pyro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuriyadeepan%2Fpm-pyro/lists"}