diff --git a/.github/workflows/bib2readme.py b/.github/workflows/bib2readme.py index 4e848ae..9ce8687 100644 --- a/.github/workflows/bib2readme.py +++ b/.github/workflows/bib2readme.py @@ -1,64 +1,124 @@ from collections import defaultdict from typing import Dict, List -import bibtexparser +from pybtex.database import parse_file +from pybtex.scanner import PybtexSyntaxError +from pylatexenc.latex2text import LatexNodes2Text # Define the categories to be printed in the README VALID_CATEGORIES = ["overview", "software", "paper", "uncategorized"] -README_HEADER = """ +README_INTRO = """ Welcome to the Awesome Amortized Inference repository! This is a curated list of resources, including overviews, software, papers, and other resources related to amortized inference. Feel free to explore the entries below and use the provided BibTeX information for citation purposes. -Contributioons always welcome, this shall be a community-driven project. -Contribution guide will follow ASAP. +Contributions are always welcome, this is a community-driven project. """ # Define Entry class class Entry: - def __init__(self, title: str, authors: str, url: str, category: str, bibtex: str): + def __init__( + self, + title: str, + authors: str, + url: str, + category: str, + awesome_fields: Dict[str, str], + bibtex: str, + ): self.title = title self.authors = authors self.url = url self.category = category + self.awesome_fields = awesome_fields self.bibtex = bibtex @classmethod - def from_bibtex(cls, entry: dict) -> "Entry": - title = entry.get("title", "No title").replace("{", "").replace("}", "") - authors = entry.get("author", "No author").replace(" and ", ", ") - url = entry.get("url", "") - category = entry.get("category", "uncategorized").lower() + def from_bibtex(cls, entry) -> "Entry": + title = entry.fields.get("title", "No title").replace("{", "").replace("}", "") + authors = ( + ", ".join( + cls.person_to_first_last(person) + for person in entry.persons.get("author", []) + ) + or "No author" + ) + url = entry.fields.get("url", "") + category = entry.fields.get("category", "uncategorized").lower() + + # get all fields that start with 'awesome-' and save them in a separate field + awesome_fields = { + key[len("awesome-") :]: value + for key, value in entry.fields.items() + if key.startswith("awesome-") + } + + if category not in VALID_CATEGORIES: + print( + f"Warning: Unrecognized category '{category}' for entry '{title}'. Categorizing as 'uncategorized'." + ) + category = "uncategorized" bibtex = cls.format_bibtex(entry) - return cls(title, authors, url, category, bibtex) + return cls(title, authors, url, category, awesome_fields, bibtex) + + @staticmethod + def person_to_first_last(person) -> str: + name_parts = [ + " ".join(part) + for part in [ + person.first_names, + person.middle_names, + person.prelast_names, + person.last_names, + person.lineage_names, + ] + if part + ] + name = " ".join(name_parts) + + return LatexNodes2Text().latex_to_text(name) @staticmethod - def format_bibtex(entry: dict) -> str: - bibtex_type = entry.get("ENTRYTYPE", "misc") - bibtex_key = entry.get("ID", "unknown") + def format_bibtex(entry) -> str: + bibtex_type = entry.type if entry.type else "misc" + bibtex_key = entry.key if entry.key else "unknown" bibtex_fields = [ - f" {key} = {{{value}}}" - for key, value in entry.items() - if key not in ["ENTRYTYPE", "ID"] + f"{key} = {{{value}}}" + for key, value in entry.fields.items() + if not key.startswith("awesome-") # exclude awesome fields from BibTeX ] + if "author" in entry.persons: + bibtex_fields.append( + f"author = {{{' and '.join(str(person) for person in entry.persons.get('author', []))}}}" + ) bibtex_str = ( - f"@{bibtex_type}{{{bibtex_key},\n " + ",\n ".join(bibtex_fields) + "\n}" + f"@{bibtex_type}{{{bibtex_key},\n  " + ",\n  ".join(bibtex_fields) + "\n}" ) return bibtex_str def to_string(self) -> str: - entry_str = f"- **{self.title}**. {self.authors}." - if self.url: - entry_str += f" [[Link]]({self.url})" - entry_str += f"
Show BibTeX
{self.bibtex}
" - entry_str += "\n" + entry_str = f"- **{self.title}**." + if self.awesome_fields: + entry_str += " " + for key, value in self.awesome_fields.items(): + entry_str += f"[[{key.capitalize()}]]({value}) " + entry_str += f"
{self.authors}" + entry_str += f""" +
+ Show BibTeX +

+  {self.bibtex}
+  
+  
+""" + # entry_str += "
" return entry_str def organize_entries(bib_database) -> Dict[str, List[Entry]]: entries_by_category: Dict[str, List[Entry]] = defaultdict(list) - for entry in bib_database.entries: + for entry_key, entry in bib_database.entries.items(): entry_obj = Entry.from_bibtex(entry) entries_by_category[entry_obj.category].append(entry_obj) return entries_by_category @@ -66,7 +126,7 @@ def organize_entries(bib_database) -> Dict[str, List[Entry]]: def create_readme(entries_by_category: Dict[str, List[Entry]]) -> str: readme_content = "# Awesome Amortized Inference\n\n" - readme_content += README_HEADER + readme_content += README_INTRO for category in VALID_CATEGORIES: if category in entries_by_category: @@ -74,17 +134,18 @@ def create_readme(entries_by_category: Dict[str, List[Entry]]) -> str: readme_content += "\n".join( [entry.to_string() for entry in entries_by_category[category]] ) - readme_content += "\n" return readme_content def main(): try: - with open("data.bib") as bibtex_file: - bib_database = bibtexparser.load(bibtex_file) + bib_database = parse_file("data.bib") except FileNotFoundError: print("The data.bib file was not found.") exit(1) + except PybtexSyntaxError as e: + print(f"Error parsing BibTeX file: {e}") + exit(1) entries_by_category = organize_entries(bib_database) readme_content = create_readme(entries_by_category) diff --git a/.github/workflows/generate_readme_from_bib.yml b/.github/workflows/generate_readme_from_bib.yml index 5fa971f..fdddf0b 100644 --- a/.github/workflows/generate_readme_from_bib.yml +++ b/.github/workflows/generate_readme_from_bib.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install bibtexparser + pip install pybtex pylatexenc # Step 4: Run the script to generate README.md - name: Run README generation script diff --git a/README.md b/README.md index 82dda50..16845c4 100644 --- a/README.md +++ b/README.md @@ -1,94 +1,156 @@ # Awesome Amortized Inference - Welcome to the Awesome Amortized Inference repository! This is a curated list of resources, including overviews, software, papers, and other resources related to amortized inference. Feel free to explore the entries below and use the provided BibTeX information for citation purposes. -Contributioons always welcome, this shall be a community-driven project. -Contribution guide will follow ASAP. +Contributions are always welcome, this is a community-driven project. + ## Overview -- **Normalizing flows for probabilistic modeling and inference**. Papamakarios, George, Nalisnick, Eric, Rezende, Danilo Jimenez, Mohamed, Shakir, Lakshminarayanan, Balaji.
Show BibTeX
@article{papamakarios2021normalizing,
-    category = {overview},
-    numpages = {64},
-    articleno = {57},
-    month = {jan},
-    journal = {J. Mach. Learn. Res.},
-    issn = {1532-4435},
-    number = {1},
-    volume = {22},
-    publisher = {JMLR.org},
-    issue_date = {January 2021},
-    year = {2021},
-    title = {Normalizing flows for probabilistic modeling and inference},
-    author = {Papamakarios, George and Nalisnick, Eric and Rezende, Danilo Jimenez and Mohamed, Shakir and Lakshminarayanan, Balaji}
-}
+- **Normalizing flows for probabilistic modeling and inference**.
George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, Balaji Lakshminarayanan +
+ Show BibTeX +

+  @article{papamakarios2021normalizing,
+  title = {Normalizing flows for probabilistic modeling and inference},
+  year = {2021},
+  publisher = {JMLR.org},
+  volume = {22},
+  number = {1},
+  issn = {1532-4435},
+  journal = {J. Mach. Learn. Res.},
+  month = {jan},
+  articleno = {57},
+  numpages = {64},
+  category = {overview},
+  author = {Papamakarios, George and Nalisnick, Eric and Rezende, Danilo Jimenez and Mohamed, Shakir and Lakshminarayanan, Balaji}
+}
+  
+  
+ +- **Neural Methods for Amortized Inference**. [[Paper]](https://arxiv.org/abs/2404.12484)
Andrew Zammit-Mangion, Matthew Sainsbury-Dale, Raphaël Huser +
+ Show BibTeX +

+  @misc{zammit-mangion2024neural,
+  title = {Neural Methods for Amortized Inference},
+  publisher = {arXiv},
+  year = {2024},
+  category = {overview},
+  author = {Zammit-Mangion, Andrew and Sainsbury-Dale, Matthew and Huser, Raphaël}
+}
+  
+  
+ +- **The frontier of simulation-based inference**. [[Paper]](http://dx.doi.org/10.1073/pnas.1912789117)
Kyle Cranmer, Johann Brehmer, Gilles Louppe +
+ Show BibTeX +

+  @article{Cranmer2020,
+  title = {The frontier of simulation-based inference},
+  volume = {117},
+  ISSN = {1091-6490},
+  DOI = {10.1073/pnas.1912789117},
+  number = {48},
+  journal = {Proceedings of the National Academy of Sciences},
+  publisher = {Proceedings of the National Academy of Sciences},
+  year = {2020},
+  pages = {30055–30062},
+  category = {overview},
+  author = {Cranmer, Kyle and Brehmer, Johann and Louppe, Gilles}
+}
+  
+  
## Software -- **BayesFlow: Amortized Bayesian Workflows With Neural Networks**. Stefan T. Radev, Marvin Schmitt, Lukas Schumacher, Lasse Elsemüller, Valentin Pratz, Yannik Schälte, Ullrich Köthe, Paul-Christian Bürkner. [[Link]](https://bayesflow.org/)
Show BibTeX
@article{radev2023bayesflow,
-    category = {software},
-    journal = {Journal of Open Source Software},
-    title = {BayesFlow: Amortized Bayesian Workflows With Neural Networks},
-    author = {Stefan T. Radev and Marvin Schmitt and Lukas Schumacher and Lasse Elsemüller and Valentin Pratz and Yannik Schälte and Ullrich Köthe and Paul-Christian Bürkner},
-    pages = {5702},
-    number = {89},
-    volume = {8},
-    publisher = {The Open Journal},
-    year = {2023},
-    url = {https://bayesflow.org/},
-    doi = {10.21105/joss.05702}
-}
+- **BayesFlow: Amortized Bayesian Workflows With Neural Networks**. [[Code]](https://bayesflow.org/)
Stefan T. Radev, Marvin Schmitt, Lukas Schumacher, Lasse Elsemüller, Valentin Pratz, Yannik Schälte, Ullrich Köthe, Paul-Christian Bürkner +
+ Show BibTeX +

+  @article{radev2023bayesflow,
+  doi = {10.21105/joss.05702},
+  year = {2023},
+  publisher = {The Open Journal},
+  volume = {8},
+  number = {89},
+  pages = {5702},
+  title = {BayesFlow: Amortized Bayesian Workflows With Neural Networks},
+  journal = {Journal of Open Source Software},
+  category = {software},
+  author = {Radev, Stefan T. and Schmitt, Marvin and Schumacher, Lukas and Elsemüller, Lasse and Pratz, Valentin and Schälte, Yannik and Köthe, Ullrich and Bürkner, Paul-Christian}
+}
+  
+  
-- **sbi: A toolkit for simulation-based inference**. Alvaro Tejero-Cantero, Jan Boelts, Michael Deistler, Jan-Matthis Lueckmann, Conor Durkan, Pedro J. Gonçalves, David S. Greenberg, Jakob H. Macke. [[Link]](https://sbi-dev.github.io/sbi/latest/)
Show BibTeX
@article{tejero-cantero2020sbi,
-    category = {software},
-    journal = {Journal of Open Source Software},
-    title = {sbi: A toolkit for simulation-based inference},
-    author = {Alvaro Tejero-Cantero and Jan Boelts and Michael Deistler and Jan-Matthis Lueckmann and Conor Durkan and Pedro J. Gonçalves and David S. Greenberg and Jakob H. Macke},
-    pages = {2505},
-    number = {52},
-    volume = {5},
-    publisher = {The Open Journal},
-    year = {2020},
-    url = {https://sbi-dev.github.io/sbi/latest/},
-    doi = {10.21105/joss.02505}
-}
+- **sbi: A toolkit for simulation-based inference**. [[Code]](https://sbi-dev.github.io/sbi/latest/)
Alvaro Tejero-Cantero, Jan Boelts, Michael Deistler, Jan-Matthis Lueckmann, Conor Durkan, Pedro J. Gonçalves, David S. Greenberg, Jakob H. Macke +
+ Show BibTeX +

+  @article{tejero-cantero2020sbi,
+  doi = {10.21105/joss.02505},
+  year = {2020},
+  publisher = {The Open Journal},
+  volume = {5},
+  number = {52},
+  pages = {2505},
+  title = {sbi: A toolkit for simulation-based inference},
+  journal = {Journal of Open Source Software},
+  category = {software},
+  author = {Tejero-Cantero, Alvaro and Boelts, Jan and Deistler, Michael and Lueckmann, Jan-Matthis and Durkan, Conor and Gonçalves, Pedro J. and Greenberg, David S. and Macke, Jakob H.}
+}
+  
+  
## Paper -- **Neural Importance Sampling for Rapid and Reliable Gravitational-Wave Inference**. Dax, Maximilian, Green, Stephen R., Gair, Jonathan, P\"{u}rrer, Michael, Wildberger, Jonas, Macke, Jakob H., Buonanno, Alessandra, Sch\"{o}lkopf, Bernhard. [[Link]](http://dx.doi.org/10.1103/PhysRevLett.130.171403)
Show BibTeX
@article{dax2023neural,
-    category = {paper},
-    year = {2023},
-    author = {Dax,  Maximilian and Green,  Stephen R. and Gair,  Jonathan and P\"{u}rrer,  Michael and Wildberger,  Jonas and Macke,  Jakob H. and Buonanno,  Alessandra and Sch\"{o}lkopf,  Bernhard},
-    publisher = {American Physical Society (APS)},
-    journal = {Physical Review Letters},
-    number = {17},
-    doi = {10.1103/physrevlett.130.171403},
-    url = {http://dx.doi.org/10.1103/PhysRevLett.130.171403},
-    issn = {1079-7114},
-    volume = {130},
-    title = {Neural Importance Sampling for Rapid and Reliable Gravitational-Wave Inference}
-}
- -- **JANA: Jointly Amortized Neural Approximation of Complex Bayesian Models**. Radev, Stefan T., Schmitt, Marvin, Pratz, Valentin, Picchini, Umberto, K\"othe, Ullrich, B\"urkner, Paul-Christian.
Show BibTeX
@inproceedings{radev2023jana,
-    category = {paper},
-    publisher = {PMLR},
-    series = {Proceedings of Machine Learning Research},
-    volume = {216},
-    editor = {Evans, Robin J. and Shpitser, Ilya},
-    year = {2023},
-    pages = {1695--1706},
-    booktitle = {Proceedings of the 39th Conference on Uncertainty in Artificial Intelligence},
-    author = {Radev, Stefan T. and Schmitt, Marvin and Pratz, Valentin and Picchini, Umberto and K\"othe, Ullrich and B\"urkner, Paul-Christian},
-    title = {{JANA: Jointly Amortized Neural Approximation of Complex Bayesian Models}}
-}
+- **Neural Importance Sampling for Rapid and Reliable Gravitational-Wave Inference**. [[Paper]](http://dx.doi.org/10.1103/PhysRevLett.130.171403)
Maximilian Dax, Stephen R. Green, Jonathan Gair, Michael Pürrer, Jonas Wildberger, Jakob H. Macke, Alessandra Buonanno, Bernhard Schölkopf +
+ Show BibTeX +

+  @article{dax2023neural,
+  title = {Neural Importance Sampling for Rapid and Reliable Gravitational-Wave Inference},
+  volume = {130},
+  ISSN = {1079-7114},
+  DOI = {10.1103/physrevlett.130.171403},
+  number = {17},
+  journal = {Physical Review Letters},
+  publisher = {American Physical Society (APS)},
+  year = {2023},
+  category = {paper},
+  author = {Dax, Maximilian and Green, Stephen R. and Gair, Jonathan and P\"{u}rrer, Michael and Wildberger, Jonas and Macke, Jakob H. and Buonanno, Alessandra and Sch\"{o}lkopf, Bernhard}
+}
+  
+  
-- **ASPIRE: Iterative Amortized Posterior Inference for Bayesian Inverse Problems**. Rafael Orozco, Ali Siahkoohi, Mathias Louboutin, Felix J. Herrmann. [[Link]](https://arxiv.org/abs/2405.05398)
Show BibTeX
@misc{orozco2024aspire,
-    category = {paper},
-    url = {https://arxiv.org/abs/2405.05398},
-    eprint = {arXiv:2405.05398},
-    year = {2024},
-    title = {ASPIRE: Iterative Amortized Posterior Inference for Bayesian Inverse Problems},
-    author = {Rafael Orozco and Ali Siahkoohi and Mathias Louboutin and Felix J. Herrmann}
-}
+- **JANA: Jointly Amortized Neural Approximation of Complex Bayesian Models**. [[Paper]](https://proceedings.mlr.press/v216/radev23a)
Stefan T. Radev, Marvin Schmitt, Valentin Pratz, Umberto Picchini, Ullrich Köthe, Paul-Christian Bürkner +
+ Show BibTeX +

+  @inproceedings{radev2023jana,
+  title = {{JANA: Jointly Amortized Neural Approximation of Complex Bayesian Models}},
+  booktitle = {Proceedings of the 39th Conference on Uncertainty in Artificial Intelligence},
+  pages = {1695--1706},
+  year = {2023},
+  volume = {216},
+  series = {Proceedings of Machine Learning Research},
+  publisher = {PMLR},
+  category = {paper},
+  author = {Radev, Stefan T. and Schmitt, Marvin and Pratz, Valentin and Picchini, Umberto and K\"othe, Ullrich and B\"urkner, Paul-Christian}
+}
+  
+  
+- **ASPIRE: Iterative Amortized Posterior Inference for Bayesian Inverse Problems**. [[Paper]](https://arxiv.org/abs/2405.05398)
Rafael Orozco, Ali Siahkoohi, Mathias Louboutin, Felix J. Herrmann +
+ Show BibTeX +

+  @misc{orozco2024aspire,
+  Title = {ASPIRE: Iterative Amortized Posterior Inference for Bayesian Inverse Problems},
+  Year = {2024},
+  Eprint = {arXiv:2405.05398},
+  category = {paper},
+  author = {Orozco, Rafael and Siahkoohi, Ali and Louboutin, Mathias and Herrmann, Felix J.}
+}
+  
+  
diff --git a/data.bib b/data.bib index 50c337d..1ea426b 100644 --- a/data.bib +++ b/data.bib @@ -2,7 +2,6 @@ @article{dax2023neural title = {Neural Importance Sampling for Rapid and Reliable Gravitational-Wave Inference}, volume = {130}, ISSN = {1079-7114}, - url = {http://dx.doi.org/10.1103/PhysRevLett.130.171403}, DOI = {10.1103/physrevlett.130.171403}, number = {17}, journal = {Physical Review Letters}, @@ -10,11 +9,11 @@ @article{dax2023neural author = {Dax, Maximilian and Green, Stephen R. and Gair, Jonathan and P\"{u}rrer, Michael and Wildberger, Jonas and Macke, Jakob H. and Buonanno, Alessandra and Sch\"{o}lkopf, Bernhard}, year = {2023}, category = {paper}, + awesome-paper = {http://dx.doi.org/10.1103/PhysRevLett.130.171403}, } @article{radev2023bayesflow, doi = {10.21105/joss.05702}, - url = {https://bayesflow.org/}, year = {2023}, publisher = {The Open Journal}, volume = {8}, @@ -23,12 +22,12 @@ @article{radev2023bayesflow author = {Stefan T. Radev and Marvin Schmitt and Lukas Schumacher and Lasse Elsemüller and Valentin Pratz and Yannik Schälte and Ullrich Köthe and Paul-Christian Bürkner}, title = {BayesFlow: Amortized Bayesian Workflows With Neural Networks}, journal = {Journal of Open Source Software} , - category = {software} + category = {software}, + awesome-code = {https://bayesflow.org/}, } @article{tejero-cantero2020sbi, doi = {10.21105/joss.02505}, - url = {https://sbi-dev.github.io/sbi/latest/}, year = {2020}, publisher = {The Open Journal}, volume = {5}, @@ -37,14 +36,14 @@ @article{tejero-cantero2020sbi author = {Alvaro Tejero-Cantero and Jan Boelts and Michael Deistler and Jan-Matthis Lueckmann and Conor Durkan and Pedro J. Gonçalves and David S. Greenberg and Jakob H. Macke}, title = {sbi: A toolkit for simulation-based inference}, journal = {Journal of Open Source Software}, - category = {software} + category = {software}, + awesome-code = {https://sbi-dev.github.io/sbi/latest/}, } @article{papamakarios2021normalizing, author = {Papamakarios, George and Nalisnick, Eric and Rezende, Danilo Jimenez and Mohamed, Shakir and Lakshminarayanan, Balaji}, title = {Normalizing flows for probabilistic modeling and inference}, year = {2021}, -issue_date = {January 2021}, publisher = {JMLR.org}, volume = {22}, number = {1}, @@ -67,6 +66,7 @@ @InProceedings{radev2023jana series = {Proceedings of Machine Learning Research}, publisher = {PMLR}, category = {paper}, + awesome-paper = {https://proceedings.mlr.press/v216/radev23a} } @misc{orozco2024aspire, @@ -74,6 +74,30 @@ @misc{orozco2024aspire Title = {ASPIRE: Iterative Amortized Posterior Inference for Bayesian Inverse Problems}, Year = {2024}, Eprint = {arXiv:2405.05398}, -url = {https://arxiv.org/abs/2405.05398}, +awesome-paper = {https://arxiv.org/abs/2405.05398}, category = {paper} +} + +@misc{zammit-mangion2024neural, + author = {Zammit-Mangion, Andrew and Sainsbury-Dale, Matthew and Huser, Raphaël}, + title = {Neural Methods for Amortized Inference}, + publisher = {arXiv}, + year = {2024}, + category = {overview}, + awesome-paper = {https://arxiv.org/abs/2404.12484}, +} + +@article{Cranmer2020, + title = {The frontier of simulation-based inference}, + volume = {117}, + ISSN = {1091-6490}, + DOI = {10.1073/pnas.1912789117}, + number = {48}, + journal = {Proceedings of the National Academy of Sciences}, + publisher = {Proceedings of the National Academy of Sciences}, + author = {Cranmer, Kyle and Brehmer, Johann and Louppe, Gilles}, + year = {2020}, + pages = {30055–30062}, + category = {overview}, + awesome-paper = {http://dx.doi.org/10.1073/pnas.1912789117}, } \ No newline at end of file