{"id":397,"date":"2020-03-25T16:12:42","date_gmt":"2020-03-26T00:12:42","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=397"},"modified":"2025-04-24T17:30:46","modified_gmt":"2025-04-24T17:30:46","slug":"new-integration-comet-pytorch-lightning","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/","title":{"rendered":"New Integration: Comet + PyTorch Lightning"},"content":{"rendered":"\n<p><i>Machine learning practitioners can now use PyTorch Lightning with Comet to speed up research cycles and build better models, faster.<\/i><\/p>\n\n\n\n<p>Machine learning practitioners can now use&nbsp;<a href=\"https:\/\/github.com\/PyTorchLightning\/pytorch-lightning\">PyTorch Lightning<\/a>, a popular deep learning framework that organizes PyTorch code to decouple the research code from the engineering code and automate it, with&nbsp;<a href=\"http:\/\/comet.ml\/\">Comet<\/a>. Comet is a leading meta machine learning experimentation platform that allows machine learning researchers and practitioners to visualize, compare and share all of their experiment data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Pytorch Lightning<\/strong><\/h3>\n\n\n\n<p><a href=\"https:\/\/pytorch-lightning.readthedocs.io\/en\/latest\/\">Lightning<\/a>&nbsp;helps organize PyTorch code and decouple the science code from the engineering code. It\u2019s more of a style-guide than a framework. By organizing PyTorch code under a LightningModule, Lightning makes things like TPU, multi-GPU and 16-bit precision training (40+ other features) trivial.<\/p>\n\n\n\n<p>Here\u2019s an example of PyTorch code organized in the Lightning format:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"784\" height=\"643\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-1.png\" alt=\"\" class=\"wp-image-407\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-1.png 784w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-1-300x246.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-1-768x630.png 768w\" sizes=\"auto, (max-width: 784px) 100vw, 784px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure id=\"attachment_2517\" class=\"wp-caption aligncenter\" aria-describedby=\"caption-attachment-2517\"><figcaption id=\"caption-attachment-2517\" class=\"wp-caption-text\">Pytorch to Lightning Conversion<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Comet<\/strong><\/h3>\n\n\n\n<p><a href=\"http:\/\/comet.ml\/\">Comet<\/a>&nbsp;is a powerful meta machine learning experimentation platform allowing users to automatically track their metrics, hyperparameters, dependencies, GPU utilization, datasets, models, debugging samples, and more, enabling much faster research cycles, and more transparent and collaborative data science.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"771\" height=\"531\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-2.png\" alt=\"\" class=\"wp-image-406\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-2.png 771w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-2-300x207.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-2-768x529.png 768w\" sizes=\"auto, (max-width: 771px) 100vw, 771px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure id=\"attachment_2518\" class=\"wp-caption aligncenter\" aria-describedby=\"caption-attachment-2518\">\n<figcaption id=\"caption-attachment-2518\" class=\"wp-caption-text\">Comet Project UI<\/figcaption>\n<\/figure>\n\n\n\n<p>Comet provides best-in-class feature richness and flexibility\u2014including a built-in hyperparameter optimization service, interactive confusion matrices, full code tracking and reproducibility features, and a wide range of on-premise installation options.<\/p>\n\n\n\n<p>To learn how to get started with PyTorch Lightning and Comet, follow along below as we go through a simple code example using the two tools. If you\u2019d prefer to be more hands on,&nbsp; continue this demo in this Google Colab&nbsp;<a href=\"https:\/\/colab.research.google.com\/drive\/17QB50LnvU7Tiye3IKZEwsvjQQ44OkScY#scrollTo=dX-vViypT8BQ&amp;forceEdit=true&amp;sandboxMode=true\">notebook<\/a>&nbsp;instead.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Install and Load Dependencies<\/b><\/h3>\n\n\n\n<p>Be sure you\u2019ve pip installed the comet-ml and PyTorch-lightning libraries.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install pytorch-lightning\npip install comet-ml<\/code><\/pre>\n\n\n\n<p>Next, in your script or notebook, import Comet\u2019s&nbsp;<a href=\"https:\/\/www.comet.com\/docs\/python-sdk\/Experiment\/\">Experiment<\/a>&nbsp;class and the&nbsp;<a href=\"https:\/\/pytorch-lightning.readthedocs.io\/en\/latest\/common\/loggers.html#comet-ml\">CometLogger<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/pytorch-lightning.readthedocs.io\/en\/latest\/common\/trainer.html\">Trainer<\/a>&nbsp;classes from PyTorch Lightning.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from comet_ml import Experiment\nfrom pytorch_lightning.loggers import CometLogger\nfrom pytorch_lightning import Trainer<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Create CometLogger<\/b><\/h3>\n\n\n\n<p>Once you\u2019ve imported your dependencies, initialize a CometLogger. You\u2019ll need to pass in your&nbsp;<a href=\"https:\/\/www.comet.com\/docs\/python-sdk\/getting-started\/\">Comet API Key<\/a>, which you can easily access once you\u2019ve signed up for Comet with Github or your email address&nbsp;<a href=\"\/signup\">here<\/a>. Projects and Workspaces are optional but help you organize which experiments belong to which modeling projects you\u2019re working on.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>comet_logger = CometLogger(\n&nbsp; &nbsp; api_key=\"YOUR COMET API KEY\",\n&nbsp; &nbsp; workspace=\"YOUR COMET WORKSPACE\", # Optional\n&nbsp; &nbsp; project_name=\"YOUR COMET PROJECT\" # Optional\n&nbsp; &nbsp; # rest_api_key=os.environ&#91;\"COMET_REST_KEY\"], # Optional\n&nbsp; &nbsp; # experiment_name=\"default\" # Optional\n)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Set up PyTorch Lightning Template<\/b><\/h3>\n\n\n\n<p>It\u2019s time to define a PyTorch Lightning Model, which will define your architecture, forward and step functions, as well as your data loaders.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class MNISTModel(pl.LightningModule):\n&nbsp; &nbsp; def __init__(self):\n&nbsp; &nbsp; &nbsp; &nbsp; super(MNISTModel, self).__init__()\n&nbsp; &nbsp; &nbsp; &nbsp; # not the best model...\n&nbsp; &nbsp; &nbsp; &nbsp; self.l1 = torch.nn.Linear(28 * 28, 10)\n&nbsp; &nbsp; def forward(self, x):\n&nbsp; &nbsp; &nbsp; &nbsp; return torch.relu(self.l1(x.view(x.size(0), -1)))\n&nbsp; &nbsp; def training_step(self, batch, batch_nb):\n&nbsp; &nbsp; &nbsp; &nbsp; # REQUIRED\n&nbsp; &nbsp; &nbsp; &nbsp; x, y = batch\n&nbsp; &nbsp; &nbsp; &nbsp; y_hat = self.forward(x)\n&nbsp; &nbsp; &nbsp; &nbsp; loss = F.cross_entropy(y_hat, y)\n&nbsp; &nbsp; &nbsp; &nbsp; tensorboard_logs = {'train_loss': loss}\n&nbsp; &nbsp; &nbsp; &nbsp; return {'loss': loss, 'log': tensorboard_logs}\n&nbsp; ...\n&nbsp; &nbsp; def train_dataloader(self):\n&nbsp; &nbsp; &nbsp; &nbsp; return DataLoader(MNIST(os.getcwd(), train=True, download=True, transform=transforms.ToTensor()), batch_size=32)&nbsp;&nbsp;...<\/code><\/pre>\n\n\n\n<p>Once you\u2019ve defined your Model class, create an instance for training.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mnist_model = MNISTModel()<\/code><\/pre>\n\n\n\n<p>Create a trainer and pass in your CometLogger instance you created earlier.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>trainer = Trainer(logger=CometLogger)<\/code><\/pre>\n\n\n\n<p>That\u2019s it! You\u2019re ready to start training your model. Simply call .fit() on your trainer, passing in the mnist_model you created earlier.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>trainer.fit(mnist_model)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Visualize Logs<\/b><\/h3>\n\n\n\n<p>Head to the Comet UI in the browser to visualize your training \u2014 metrics, parameters, code, system metrics, and more \u2014 in real time.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"935\" height=\"623\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-3.png\" alt=\"\" class=\"wp-image-405\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-3.png 935w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-3-300x200.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-3-768x512.png 768w\" sizes=\"auto, (max-width: 935px) 100vw, 935px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure id=\"attachment_2528\" class=\"wp-caption aligncenter\" aria-describedby=\"caption-attachment-2528\">\n<figcaption id=\"caption-attachment-2528\" class=\"wp-caption-text\">Comet Project UI<\/figcaption>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Inspect Dataset Samples<\/b><\/h3>\n\n\n\n<p>Comet has dedicated modules for almost every type of data you may be modeling with. Using the Comet Graphics module, easily log and inspect dataset samples right in the UI.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for _ in range(10):\n&nbsp; &nbsp; value = random.randint(0, len(images))\n&nbsp; &nbsp; tmp = images&#91;value]\n&nbsp; &nbsp; img = tmp.numpy()&#91;0]\n&nbsp; &nbsp; comet_logger.experiment.log_image(img, name=\"label :{}\".format(labels&#91;value]))<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"535\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-4.png\" alt=\"\" class=\"wp-image-404\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-4.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-4-300x157.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-4-768x401.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure id=\"attachment_2540\" class=\"wp-caption aligncenter\" aria-describedby=\"caption-attachment-2540\">\n<figcaption id=\"caption-attachment-2540\" class=\"wp-caption-text\">Comet Graphics Module<\/figcaption>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Generate Interactive Confusion Matrices for Model Debugging<\/b><\/h3>\n\n\n\n<p>Comet also allows you to create interactive confusion matrices in the UI, allowing you to visualize predictions and debug your model efficiently. (See the&nbsp;<a href=\"https:\/\/colab.research.google.com\/drive\/17QB50LnvU7Tiye3IKZEwsvjQQ44OkScY#scrollTo=dX-vViypT8BQ&amp;forceEdit=true&amp;sandboxMode=true\">Google Colab notebook<\/a>&nbsp;for the code used to generate these confusion matrices.)<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"659\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-5.png\" alt=\"\" class=\"wp-image-403\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-5.png 1024w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-5-300x193.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-5-768x494.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<figure id=\"attachment_2541\" class=\"wp-caption aligncenter\" aria-describedby=\"caption-attachment-2541\">\n<figcaption id=\"caption-attachment-2541\" class=\"wp-caption-text\">Comet Confusion Matrix Module<\/figcaption>\n<\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><b>Store your Trained Model to the Comet Model Registry<\/b><\/h3>\n\n\n\n<p>Once you\u2019ve trained a model you\u2019d like to save for future use (training in the future, taking into production, etc.), use the Comet Model Registry to do just that. Once you\u2019ve saved your model, simply call experiment.log_model() to store your model in Comet\u2019s Model Registry.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>torch.save(mnist_model.state_dict(), 'my_model')\ncomet_logger.experiment.log_model('model_0', '.\/my_model')<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"958\" height=\"383\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-6.png\" alt=\"\" class=\"wp-image-402\" srcset=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-6.png 958w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-6-300x120.png 300w, https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/02\/image-6-768x307.png 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/figure>\n\n\n\n<figure id=\"attachment_2542\" class=\"wp-caption aligncenter\" aria-describedby=\"caption-attachment-2542\">\n<figcaption id=\"caption-attachment-2542\" class=\"wp-caption-text\">Comet Model Registry UI<\/figcaption>\n<\/figure>\n\n\n\n<p>For more information on PyTorch Lightning and the CometLogger, consult the docs&nbsp;<a href=\"https:\/\/pytorch-lightning.readthedocs.io\/en\/latest\/common\/loggers.html#comet-ml\">here<\/a>. For more information on Comet\u2019s experiment management capabilities, check out Comet\u2019s docs&nbsp;<a href=\"https:\/\/www.comet.com\/docs\/user-interface\/\">here<\/a>.<\/p>\n\n\n\n<p><em>This post was written with the help of&nbsp;<a href=\"https:\/\/www.williamfalcon.com\/\">Will Falcon<\/a>, creator of PyTorch Lightning.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Machine learning practitioners can now use PyTorch Lightning with Comet to speed up research cycles and build better models, faster. Machine learning practitioners can now use&nbsp;PyTorch Lightning, a popular deep learning framework that organizes PyTorch code to decouple the research code from the engineering code and automate it, with&nbsp;Comet. Comet is a leading meta machine [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":399,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"categories":[5],"tags":[],"coauthors":[106],"class_list":["post-397","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-partners-integrations"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>New Integration Comet Pytorch Lightning | Comet<\/title>\n<meta name=\"description\" content=\"New integration: Comet and PyTorch Lightning. Use PyTorch Lightning with Comet to speed up research cycles and build better models, faster.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New Integration: Comet + PyTorch Lightning\" \/>\n<meta property=\"og:description\" content=\"New integration: Comet and PyTorch Lightning. Use PyTorch Lightning with Comet to speed up research cycles and build better models, faster.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-26T00:12:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:30:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2020\/03\/Group-1-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"985\" \/>\n\t<meta property=\"og:image:height\" content=\"357\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nikolas Laskaris\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikolas Laskaris\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"New Integration Comet Pytorch Lightning | Comet","description":"New integration: Comet and PyTorch Lightning. Use PyTorch Lightning with Comet to speed up research cycles and build better models, faster.","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:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/","og_locale":"en_US","og_type":"article","og_title":"New Integration: Comet + PyTorch Lightning","og_description":"New integration: Comet and PyTorch Lightning. Use PyTorch Lightning with Comet to speed up research cycles and build better models, faster.","og_url":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2020-03-26T00:12:42+00:00","article_modified_time":"2025-04-24T17:30:46+00:00","og_image":[{"width":985,"height":357,"url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2020\/03\/Group-1-2.png","type":"image\/png"}],"author":"Nikolas Laskaris","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Nikolas Laskaris","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/"},"author":{"name":"Matt Peternell","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/85aa446f8be987e848ea929ef524b67b"},"headline":"New Integration: Comet + PyTorch Lightning","datePublished":"2020-03-26T00:12:42+00:00","dateModified":"2025-04-24T17:30:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/"},"wordCount":668,"commentCount":0,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2020\/03\/Group-1-2.png","articleSection":["Partners &amp; Integrations"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/","url":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/","name":"New Integration Comet Pytorch Lightning | Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2020\/03\/Group-1-2.png","datePublished":"2020-03-26T00:12:42+00:00","dateModified":"2025-04-24T17:30:46+00:00","description":"New integration: Comet and PyTorch Lightning. Use PyTorch Lightning with Comet to speed up research cycles and build better models, faster.","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/#primaryimage","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2020\/03\/Group-1-2.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2020\/03\/Group-1-2.png","width":985,"height":357,"caption":"Comet & Pytorch Lightning | Comet ML"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/new-integration-comet-pytorch-lightning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"New Integration: Comet + PyTorch Lightning"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/85aa446f8be987e848ea929ef524b67b","name":"Matt Peternell","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/da003ee51bbeeccfb95147ec69139879","url":"https:\/\/secure.gravatar.com\/avatar\/36058153d701caaf237a96d5d6fb9c2d1678325c3ed0d8e88bf5e487019a2a53?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/36058153d701caaf237a96d5d6fb9c2d1678325c3ed0d8e88bf5e487019a2a53?s=96&d=mm&r=g","caption":"Matt Peternell"},"description":"We re-implemented the architecture of this model to incorporate patient and study information. By comparing our updated model to the original Github repository, we were able to quantify the benefits of classifying by patient as opposed to classifying by individual X-ray. We observed a 0.0254 increase in AUROC when evaluating the DenseNet121 on patients instead of on individual scans.","sameAs":["http:\/\/atre.net"],"url":"https:\/\/www.comet.com\/site\/blog\/author\/mpeternellatre-net\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=397"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":15699,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/397\/revisions\/15699"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media\/399"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=397"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}