{"id":15626311,"url":"https://github.com/aamini/evidential-deep-learning","last_synced_at":"2025-04-04T13:08:59.653Z","repository":{"id":37671967,"uuid":"305911875","full_name":"aamini/evidential-deep-learning","owner":"aamini","description":"Learn fast, scalable, and calibrated measures of uncertainty using neural networks! ","archived":false,"fork":false,"pushed_at":"2021-08-31T17:51:42.000Z","size":9842,"stargazers_count":463,"open_issues_count":15,"forks_count":95,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-28T12:05:48.971Z","etag":null,"topics":["confidence","deep-learning","evidence","neural-network","neurips-2020","pytorch","tensorflow","uncertainty"],"latest_commit_sha":null,"homepage":"https://proceedings.neurips.cc/paper/2020/file/aab085461de182608ee9f607f3f7d18f-Paper.pdf","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aamini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null}},"created_at":"2020-10-21T04:52:02.000Z","updated_at":"2025-03-27T18:59:25.000Z","dependencies_parsed_at":"2022-07-08T07:41:59.024Z","dependency_job_id":null,"html_url":"https://github.com/aamini/evidential-deep-learning","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamini%2Fevidential-deep-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamini%2Fevidential-deep-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamini%2Fevidential-deep-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamini%2Fevidential-deep-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aamini","download_url":"https://codeload.github.com/aamini/evidential-deep-learning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182335,"owners_count":20897379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["confidence","deep-learning","evidence","neural-network","neurips-2020","pytorch","tensorflow","uncertainty"],"created_at":"2024-10-03T10:11:54.685Z","updated_at":"2025-04-04T13:08:59.636Z","avatar_url":"https://github.com/aamini.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Evidential Deep Learning\n\n\u003ch3 align='center'\u003e\"All models are wrong, but some — \u003ci\u003ethat know when they can be trusted\u003c/i\u003e — are useful!\"\u003c/h3\u003e\n\u003cp align='right'\u003e\u003ci\u003e- George Box (Adapted)\u003c/i\u003e\u003c/p\u003e\n\n\n![](assets/banner.png)\n\nThis repository contains the code to reproduce [Deep Evidential Regression](https://proceedings.neurips.cc/paper/2020/file/aab085461de182608ee9f607f3f7d18f-Paper.pdf), as published in [NeurIPS 2020](https://neurips.cc/), as well as more general code to leverage evidential learning to train neural networks to learn their own measures of uncertainty directly from data!\n\n## Setup\nTo use this package, you must install the following dependencies first: \n- python (\u003e=3.7)\n- tensorflow (\u003e=2.0)\n- pytorch (support coming soon)\n\nNow you can install to start adding evidential layers and losses to your models!\n```\npip install evidential-deep-learning\n```\nNow you're ready to start using this package directly as part of your existing `tf.keras` model pipelines (`Sequential`, `Functional`, or `model-subclassing`):\n```\n\u003e\u003e\u003e import evidential_deep_learning as edl\n```\n\n### Example\nTo use evidential deep learning, you must edit the last layer of your model to be *evidential* and use a supported loss function to train the system end-to-end. This repository supports evidential layers for both fully connected and convolutional (2D) layers. The evidential prior distribution presented in the paper follows a Normal Inverse-Gamma and can be added to your model: \n\n```\nimport evidential_deep_learning as edl\nimport tensorflow as tf\n\nmodel = tf.keras.Sequential(\n    [\n        tf.keras.layers.Dense(64, activation=\"relu\"),\n        tf.keras.layers.Dense(64, activation=\"relu\"),\n        edl.layers.DenseNormalGamma(1), # Evidential distribution!\n    ]\n)\nmodel.compile(\n    optimizer=tf.keras.optimizers.Adam(1e-3), \n    loss=edl.losses.EvidentialRegression # Evidential loss!\n)\n```\n\n![](assets/animation.gif)\nCheckout `hello_world.py` for an end-to-end toy example walking through this step-by-step. For more complex examples, scaling up to computer vision problems (where we learn to predict tens of thousands of evidential distributions simultaneously!), please refer to the NeurIPS 2020 paper, and the reproducibility section of this repo to run those examples. \n\n## Reproducibility\nAll of the results published as part of our NeurIPS paper can be reproduced as part of this repository. Please refer to [the reproducibility section](./neurips2020) for details and instructions to obtain each result. \n\n## Citation\nIf you use this code for evidential learning as part of your project or paper, please cite the following work:  \n\n    @article{amini2020deep,\n      title={Deep evidential regression},\n      author={Amini, Alexander and Schwarting, Wilko and Soleimany, Ava and Rus, Daniela},\n      journal={Advances in Neural Information Processing Systems},\n      volume={33},\n      year={2020}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faamini%2Fevidential-deep-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faamini%2Fevidential-deep-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faamini%2Fevidential-deep-learning/lists"}