{"id":5648365,"date":"2023-07-10T08:36:34","date_gmt":"2023-07-10T12:36:34","guid":{"rendered":"https:\/\/lightning.ai\/pages\/?p=5648365"},"modified":"2023-07-13T12:34:17","modified_gmt":"2023-07-13T16:34:17","slug":"torchmetrics-a-short-history-to-100-metrics","status":"publish","type":"post","link":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/","title":{"rendered":"TorchMetrics \u2014 a short history to 100+ metrics"},"content":{"rendered":"<p>As a celebration of v1.0.0 of Torchmetrics being <a href=\"https:\/\/lightning.ai\/blog\/torchmetrics-v1.0-100-metrics-and-plotting\/\">released<\/a>, in this blogpost we will discuss the history of Torchmetrics and how the interface have evolved over time.<\/p>\n<p>It all started in the pretty early days of Pytorch Lightning. More specifically on April 1st, 2020. On this date, the <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/1293\">first proposal<\/a> for a metric interface was submitted to <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\">PyTorch Lightning<\/a>, after an extensive discussion between <a href=\"https:\/\/github.com\/williamFalcon\">William Falcon<\/a> (the founder of <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\">PyTorch Lightning<\/a>), <a href=\"https:\/\/github.com\/Borda\">Jiri Borovec<\/a> (the first fulltime developer of PyTorch Lightning), <a href=\"https:\/\/github.com\/tullie\">Tullie Murell<\/a>, <a href=\"https:\/\/github.com\/Darktex\">Davide Testuggine<\/a> (both working at FAIR at this time) and <a href=\"https:\/\/github.com\/justusschock\">Justus Schock<\/a> (interested in contributing such a package; later became the first Tech Lead for metrics in <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\">PyTorch Lightning<\/a>). This discussion was predated by a more general <a href=\"https:\/\/github.com\/pytorch\/pytorch\/issues\/22439\">discussion in the PyTorch issues<\/a>, showing the general need for a unified metrics package.<\/p>\n<p>The initial draft was then quickly refined by a few other PRs and finally landed on April 3rd (2020) with the following main interface introduced by <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/1326\">this<\/a> PR:<\/p>\n<pre class=\"hljs collapse-false language-python\"><code class=\"language-python\">class Metric(torch.nn.Module, ABC):\r\n    \"\"\"\r\n    Abstract Base Class for metric implementation.\r\n    Should be used to implement metrics that\r\n    1. Return multiple Outputs\r\n    2. Handle their own DDP sync\r\n    \"\"\"\r\n    def __init__(self, name: str):\r\n        ...\r\n\r\n    def forward(self, *args, **kwargs) -&gt; torch.Tensor:\r\n        \"\"\"\r\n        Implements the actual metric computation.\r\n        Returns:\r\n            metric value\r\n        \"\"\"\r\n        raise NotImplementedError\r\n     ...\r\n<\/code><\/pre>\n<p>It also included a lot of utilities to make dtype and devices available from the Module itself \u2014 a lot of which can still be found today in the <code><a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/blob\/master\/src\/lightning\/fabric\/utilities\/device_dtype_mixin.py#L22\">DeviceDtypeModuleMixin<\/a><\/code>\u00a0that currently lives in <code>lightning.fabric<\/code>.<\/p>\n<p>The core design elements of the <code>Metric<\/code> class at this time were:<\/p>\n<ul>\n<li>follow the <code>nn.Module<\/code>-API as closely as possible since people were already familiar with it<\/li>\n<li>enable distributed communications for metrics<\/li>\n<li>make it easy to integrate metrics from <code><a href=\"https:\/\/scikit-learn.org\/stable\/modules\/model_evaluation.html\">scikit-learn<\/a><\/code><\/li>\n<\/ul>\n<p>The last point was especially important for the beginning. While being inefficient when it comes to <code>numpy.ndarray<\/code> \u2194 <code>torch.CudaTensor<\/code> conversions (this introduces a GPU-synchronization point and GPU\u2194CPU memory transfer), <code>scikit-learn<\/code> metrics were considered the gold standard for metric computation and their correctness. Implementing most metrics with a <code>scikit-learn<\/code> backend also allowed us to quickly increase the number of metrics while not worrying too much about their correctness.<\/p>\n<p>On May 19th, a PR to further differentiate between <code>NumpyMetric<\/code> and <code>TensorMetric<\/code> landed, introducing also one of the most commonly used functions throughout PyTorch Lightning\u2019s codebase to this date: <code><a href=\"https:\/\/github.com\/Lightning-AI\/utilities\/blob\/main\/src\/lightning_utilities\/core\/apply_func.py#L23\">apply_to_collection<\/a><\/code>\u00a0(which was later outsourced to our <a href=\"https:\/\/github.com\/Lightning-AI\/utilities\/blob\/main\/src\/lightning_utilities\">utilities<\/a> package to make use of this function even in our projects outside of the <code>lightning<\/code> package). This PR marks the beginning of proper support for distributed aggregation in <code>PyTorch Lightning<\/code>.<\/p>\n<p>On June 10th (2020) then finally the first <code>sklearn<\/code> metrics were added directly to the package by <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/1327\">this<\/a> PR. At first it were only a few, most commonly used ones (only classification at this point) like Accuracy, AveragePrecision, AUC, ConfusionMatrix, F1, FBeta, Precision, Recall, PrecisionRecallCurve, ROC and AUROC. On June 13th (2020) a lot of these metrics were already replaced by native PyTorch implementations in <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/1488\/files\">https:\/\/github.com\/Lightning-AI\/lightning\/pull\/1488\/files<\/a>.<\/p>\n<p>June 15th (2020) is another important date for <code>TorchMetrics<\/code>: It marks the first contribution to the <code>PyTorch Lightning.metrics<\/code> package by <a href=\"https:\/\/github.com\/SkafteNicki\">Nicki Skafte<\/a> with <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/2183\">his first bugfix<\/a>.<\/p>\n<p>All of these changes were then released in <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/releases\/tag\/0.8.0\">PyTorch Lightning 0.8.0.<\/a><\/p>\n<p>After the release of 0.8.0, Nicki ramped up his contributions ranging from <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/2562\">adding missing scikit-learn metrics<\/a> over <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/3358\">completely new PyTorch-native metrics like embedding similarity<\/a>, our <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/2528\">first API refactor<\/a>, <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/4122\">speeding up our tests<\/a> by a factor of 26 to the <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/4318\">introduction of <code>MetricCollection<\/code><\/a>. It is safe to say, that Nicki was a core-developer of the <code>metrics<\/code> subpackage by this point!<\/p>\n<p>With the release of <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/releases\/tag\/0.10.0\">PyTorch Lightning 0.10.0<\/a>, another important Milestone was passed: An <a href=\"https:\/\/github.com\/Lightning-AI\/lightning\/pull\/3868\">entire API overhaul<\/a> by Teddy Koker and Ananya Harsh Jha. From now on, metrics implemented the today well known API of <code>update-compute:<\/code><\/p>\n<pre class=\"hljs collapse-false language-python\"><code class=\"language-python\">class MyMetric(Metric):\r\n    def __init__(self, ...):\r\n        super().__init__(self)\r\n        ...\r\n\r\n    def update(self, ...):\r\n        ...\r\n\r\n    def compute(self):\r\n        ...\r\n<\/code><\/pre>\n<p>In this case, a <code>Metric<\/code> has an internal state, which is updated by <code>update<\/code>. This internal representation is in many cases more memory efficient than just storing all samples in memory and waiting for a call to <code>compute<\/code>. This allows the computation of metrics over datasets which don\u2019t fit in memory since for correct calculation, the entire dataset is needed. This is one of the downsides of <code>scikit-learn<\/code>: It doesn\u2019t implement batched metric calculation, which is crucial for deep learning. The internal state is also what\u2019s efficiently synced between GPUs when calculating metrics in a distributed fashion to ensure mathematical correctness.<\/p>\n<p>While the interface is nearly 3 years old at this point it has not change significantly, which lead to Torchmetrics have a stable user interface before it was even called Torchmetrics. On February 22 (2021) then, the existing <code>metrics<\/code> code was moved to it\u2019s own package (<code>torchmetrics<\/code>), while amazingly preserving our entire commit history by Jiri Borovec.<\/p>\n<p>Since then, many more metrics and fixes were contributed by many different contributors. The framework as grown from a around 20 metrics to well above 100 in the newest release. Additionally, while the initial version only covered <code>Regression<\/code> and <code>Classification<\/code> metrics, Torchmetrics today covers many more: <code>Audio<\/code>, <code>Detection<\/code>, <code>Image<\/code>, <code>Retrieval<\/code>, <code>Text<\/code> etc.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5648366 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/Figure_1-e1688993742737.png\" alt=\"\" width=\"1995\" height=\"1405\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/Figure_1-e1688993742737.png 1995w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/Figure_1-e1688993742737-300x211.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/Figure_1-e1688993742737-1024x721.png 1024w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/Figure_1-e1688993742737-1536x1082.png 1536w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/Figure_1-e1688993742737-768x541.png 768w\" sizes=\"(max-width: 1995px) 100vw, 1995px\" \/><\/p>\n<p>In February 2022 we then invited the most active contributors to write a paper with us. The result was the paper <code><a href=\"https:\/\/joss.theoj.org\/papers\/10.21105\/joss.04101\">TorchMetrics - Measuring Reproducibility in PyTorch<\/a><\/code> by Nicki Skafte, Jiri Borovec, Justus Schock, Ananya Harsh, Teddy Koker, Luca Di Liello, Daniel Stancl, Chansheng Quang, Maxim Grechkin and William Falcon which was published in the Journal of Open-Source Software (JOSS) on February, 11th 2022.<\/p>\n<p>After a bunch of more fixes and metrics (led by Nicki Skafte, current Tech Lead of <code>TorchMetrics<\/code>), we are proud to finally announce the <a href=\"https:\/\/github.com\/Lightning-AI\/torchmetrics\/releases\/tag\/v1.0.0\">1.0.0 release<\/a> on July 5th 2023 with over <strong>100 metric implementations<\/strong> and also launching the newest features: <em>plotting and visualizing metrics<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5648367\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/figure-2.png\" alt=\"\" width=\"2000\" height=\"512\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/figure-2.png 2000w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/figure-2-300x77.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/figure-2-1024x262.png 1024w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/figure-2-1536x393.png 1536w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/figure-2-300x77@2x.png 600w\" sizes=\"(max-width: 2000px) 100vw, 2000px\" \/><\/p>\n<p>We are sure, this only marks the beginning of a successful journey for <code>TorchMetrics<\/code> and there\u2019ll be many more metrics to come!<\/p>\n<p dir=\"auto\">\n<p dir=\"auto\">Finally, If you would like to give open source contribution a try, we have the <code>#want-to-contribute<\/code> and\u00a0<code>#torchmetrics<\/code> channel on the Lightning AI <a href=\"https:\/\/discord.gg\/TKRzyC5hxW\">Discord<\/a>\u00a0where you can ask a question and get guidance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a celebration of v1.0.0 of Torchmetrics being released, in this blogpost we will discuss the history of Torchmetrics and how the interface have evolved over time. It all started in the pretty early days of Pytorch Lightning. More specifically on April 1st, 2020. On this date, the first proposal for a metric interface was<a class=\"excerpt-read-more\" href=\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/\" title=\"ReadTorchMetrics \u2014 a short history to 100+ metrics\">&#8230; Read more &raquo;<\/a><\/p>\n","protected":false},"author":39,"featured_media":5648369,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[27,29],"tags":[237],"glossary":[],"acf":{"additional_authors":[{"author_name":"Justus Schock","author_url":""},{"author_name":"Nicki Skafte Detlefsen","author_url":""}],"mathjax":false,"default_editor":true,"show_table_of_contents":false,"hide_from_archive":false,"content_type":"Blog Post","sticky":false,"custom_styles":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TorchMetrics \u2014 a short history to 100+ metrics - Lightning AI<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TorchMetrics \u2014 a short history to 100+ metrics - Lightning AI\" \/>\n<meta property=\"og:description\" content=\"As a celebration of v1.0.0 of Torchmetrics being released, in this blogpost we will discuss the history of Torchmetrics and how the interface have evolved over time. It all started in the pretty early days of Pytorch Lightning. More specifically on April 1st, 2020. On this date, the first proposal for a metric interface was... Read more &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/\" \/>\n<meta property=\"og:site_name\" content=\"Lightning AI\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-10T12:36:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-13T16:34:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Lightning.ai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LightningAI\" \/>\n<meta name=\"twitter:site\" content=\"@LightningAI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lightning.ai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/\"},\"author\":{\"name\":\"Lightning.ai\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/d53c9386be275d278c59022570c0d859\"},\"headline\":\"TorchMetrics \u2014 a short history to 100+ metrics\",\"datePublished\":\"2023-07-10T12:36:34+00:00\",\"dateModified\":\"2023-07-13T16:34:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/\"},\"wordCount\":895,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png\",\"keywords\":[\"torchmetrics\"],\"articleSection\":[\"Articles\",\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/\",\"url\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/\",\"name\":\"TorchMetrics \u2014 a short history to 100+ metrics - Lightning AI\",\"isPartOf\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png\",\"datePublished\":\"2023-07-10T12:36:34+00:00\",\"dateModified\":\"2023-07-13T16:34:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#primaryimage\",\"url\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png\",\"contentUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png\",\"width\":1600,\"height\":900},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lightning.ai\/pages\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TorchMetrics \u2014 a short history to 100+ metrics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lightning.ai\/pages\/#website\",\"url\":\"https:\/\/lightning.ai\/pages\/\",\"name\":\"Lightning AI\",\"description\":\"The platform for teams to build AI.\",\"publisher\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lightning.ai\/pages\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\",\"name\":\"Lightning AI\",\"url\":\"https:\/\/lightning.ai\/pages\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png\",\"contentUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png\",\"width\":1744,\"height\":856,\"caption\":\"Lightning AI\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/LightningAI\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/d53c9386be275d278c59022570c0d859\",\"name\":\"Lightning.ai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b75fef9be69cb600f385dfba5525cf77?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b75fef9be69cb600f385dfba5525cf77?s=96&d=mm&r=g\",\"caption\":\"Lightning.ai\"},\"url\":\"https:\/\/lightning.ai\/pages\/author\/lightning-ai\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"TorchMetrics \u2014 a short history to 100+ metrics - Lightning AI","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/","og_locale":"en_US","og_type":"article","og_title":"TorchMetrics \u2014 a short history to 100+ metrics - Lightning AI","og_description":"As a celebration of v1.0.0 of Torchmetrics being released, in this blogpost we will discuss the history of Torchmetrics and how the interface have evolved over time. It all started in the pretty early days of Pytorch Lightning. More specifically on April 1st, 2020. On this date, the first proposal for a metric interface was... Read more &raquo;","og_url":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/","og_site_name":"Lightning AI","article_published_time":"2023-07-10T12:36:34+00:00","article_modified_time":"2023-07-13T16:34:17+00:00","og_image":[{"width":1600,"height":900,"url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png","type":"image\/png"}],"author":"Lightning.ai","twitter_card":"summary_large_image","twitter_creator":"@LightningAI","twitter_site":"@LightningAI","twitter_misc":{"Written by":"Lightning.ai","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#article","isPartOf":{"@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/"},"author":{"name":"Lightning.ai","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/d53c9386be275d278c59022570c0d859"},"headline":"TorchMetrics \u2014 a short history to 100+ metrics","datePublished":"2023-07-10T12:36:34+00:00","dateModified":"2023-07-13T16:34:17+00:00","mainEntityOfPage":{"@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/"},"wordCount":895,"commentCount":0,"publisher":{"@id":"https:\/\/lightning.ai\/pages\/#organization"},"image":{"@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#primaryimage"},"thumbnailUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png","keywords":["torchmetrics"],"articleSection":["Articles","Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/","url":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/","name":"TorchMetrics \u2014 a short history to 100+ metrics - Lightning AI","isPartOf":{"@id":"https:\/\/lightning.ai\/pages\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#primaryimage"},"image":{"@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#primaryimage"},"thumbnailUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png","datePublished":"2023-07-10T12:36:34+00:00","dateModified":"2023-07-13T16:34:17+00:00","breadcrumb":{"@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#primaryimage","url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png","contentUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/07\/5-july.png","width":1600,"height":900},{"@type":"BreadcrumbList","@id":"https:\/\/lightning.ai\/pages\/blog\/torchmetrics-a-short-history-to-100-metrics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lightning.ai\/pages\/"},{"@type":"ListItem","position":2,"name":"TorchMetrics \u2014 a short history to 100+ metrics"}]},{"@type":"WebSite","@id":"https:\/\/lightning.ai\/pages\/#website","url":"https:\/\/lightning.ai\/pages\/","name":"Lightning AI","description":"The platform for teams to build AI.","publisher":{"@id":"https:\/\/lightning.ai\/pages\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lightning.ai\/pages\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/lightning.ai\/pages\/#organization","name":"Lightning AI","url":"https:\/\/lightning.ai\/pages\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/","url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png","contentUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png","width":1744,"height":856,"caption":"Lightning AI"},"image":{"@id":"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/LightningAI"]},{"@type":"Person","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/d53c9386be275d278c59022570c0d859","name":"Lightning.ai","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b75fef9be69cb600f385dfba5525cf77?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b75fef9be69cb600f385dfba5525cf77?s=96&d=mm&r=g","caption":"Lightning.ai"},"url":"https:\/\/lightning.ai\/pages\/author\/lightning-ai\/"}]}},"_links":{"self":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts\/5648365"}],"collection":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/comments?post=5648365"}],"version-history":[{"count":0,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts\/5648365\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/media\/5648369"}],"wp:attachment":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/media?parent=5648365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/categories?post=5648365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/tags?post=5648365"},{"taxonomy":"glossary","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/glossary?post=5648365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}