{"id":8064,"date":"2023-11-02T09:15:23","date_gmt":"2023-11-02T17:15:23","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/?p=8064"},"modified":"2025-04-24T17:04:59","modified_gmt":"2025-04-24T17:04:59","slug":"how-to-log-your-keras-deep-learning-experiments-with-comet","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet\/","title":{"rendered":"How to Log Your Keras Deep Learning Experiments With Comet"},"content":{"rendered":"\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet\">\n\n\n\n<div class=\"fk fl fm fn fo\">\n<div class=\"ab ca\">\n<div class=\"ch bg ew ex ey ez\">\n<figure class=\"ly lz ma mb mc md lv lw paragraph-image\">\n<div class=\"me mf ee mg bg mh\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mi mj c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*elTFp8dyQeoOPs3OSa2QxA.jpeg\" alt=\"\" width=\"700\" height=\"467\"><\/figure><div class=\"lv lw lx\"><picture><\/picture><\/div>\n<\/div><figcaption class=\"mk ml mm lv lw mn mo be b bf z dw\" data-selectable-paragraph=\"\"><a class=\"af mp\" href=\"https:\/\/www.freepik.com\/free-vector\/human-nervous-system_4239572.htm#query=artificial%20intelligence%20brain&amp;position=0&amp;from_view=keyword\" target=\"_blank\" rel=\"noopener ugc nofollow\">Image<\/a> by <a class=\"af mp\" href=\"http:\/\/rawpixel.com\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">rawpixel.com<\/a> on <a class=\"af mp\" href=\"https:\/\/www.freepik.com\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Freepik<\/a><\/figcaption><\/figure>\n<h1 id=\"b924\" class=\"mq mr fr be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Overview<\/h1>\n<p id=\"c4a6\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">Let us start by asking ourselves some questions: Have you ever wondered how Google\u2019s translation app can instantly convert entire paragraphs between two languages?<\/p>\n<p id=\"9c36\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">How do Netflix and YouTube know what movies or videos we like, and how do they provide suitable recommendations? Or how do autonomous vehicles even become a possibility?<\/p>\n<p id=\"8e31\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Other practical examples of deep learning include virtual assistants, chatbots, robotics, image restoration, NLP (Natural Language Processing), and so on. Now that we have our questions let us start providing answers to them.<\/p>\n<p id=\"9a1e\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">This article will discuss deep learning using Keras and, most importantly, how we will log our models to Comet.<\/p>\n<blockquote class=\"oq or os\"><p id=\"690d\" class=\"no np ot be b nq ol ns nt nu om nw nx ou on oa ob ov oo oe of ow op oi oj ok fk bj\" data-selectable-paragraph=\"\">The code for this tutorial is based on <a class=\"af mp\" href=\"https:\/\/www.kaggle.com\/code\/kenjee\/challenge-4-tutorial-3-neural-nets\" target=\"_blank\" rel=\"noopener ugc nofollow\">this notebook<\/a> by Ken Jee from the <a class=\"af mp\" href=\"https:\/\/www.kaggle.com\/datasets\/kenjee\/z-by-hp-unlocked-challenge-4-image-classification\" target=\"_blank\" rel=\"noopener ugc nofollow\">Z by HP Unlocked Challenge 4: Image Classification<\/a>.<\/p><\/blockquote>\n<h1 id=\"a1fc\" class=\"mq mr fr be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">What is Deep Learning?<\/h1>\n<p id=\"6cb8\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">Experience is the best teacher. The more we learn, the richer our experiences. The same is true for machines running AI hardware and software in the deep learning field of artificial intelligence (AI). The data that machines gather defines the experiences through which they can learn, and the quantity and quality of data determine how much they can learn.<\/p>\n<p id=\"519f\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">A branch of machine learning is <strong class=\"be ox\">deep learning<\/strong>. Deep learning systems can perform better with access to more data, which is the machine equivalent of more experience, in contrast to typical machine learning algorithms, many of which have a finite ability to learn regardless of the amount of data they obtain. Machines may be trained to perform specific activities such as driving a car, spotting weeds in a field of crops, diagnosing illnesses, checking machinery for flaws, and other jobs once they have acquired sufficient experience through deep learning.<\/p>\n<p id=\"c4f9\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Neural networks are motivated by the human brain\u2019s organization. By repeatedly examining data according to a predetermined logical framework, deep learning computers try to reach the same conclusions as people. Deep learning does this via a multi-layered neural network algorithmic framework.<\/p>\n<figure class=\"oz pa pb pc pd md lv lw paragraph-image\">\n<div class=\"me mf ee mg bg mh\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mi mj c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*MCmuGBrbLPqssZncpKhRZA.png\" alt=\"\" width=\"700\" height=\"277\"><\/figure><div class=\"lv lw oy\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*MCmuGBrbLPqssZncpKhRZA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*MCmuGBrbLPqssZncpKhRZA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*MCmuGBrbLPqssZncpKhRZA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*MCmuGBrbLPqssZncpKhRZA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*MCmuGBrbLPqssZncpKhRZA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*MCmuGBrbLPqssZncpKhRZA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*MCmuGBrbLPqssZncpKhRZA.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*MCmuGBrbLPqssZncpKhRZA.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*MCmuGBrbLPqssZncpKhRZA.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*MCmuGBrbLPqssZncpKhRZA.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*MCmuGBrbLPqssZncpKhRZA.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*MCmuGBrbLPqssZncpKhRZA.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*MCmuGBrbLPqssZncpKhRZA.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*MCmuGBrbLPqssZncpKhRZA.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mk ml mm lv lw mn mo be b bf z dw\" data-selectable-paragraph=\"\">A typical neural network; image from <a class=\"af mp\" href=\"https:\/\/towardsdatascience.com\/what-is-deep-learning-and-how-does-it-work-2ce44bb692ac\" target=\"_blank\" rel=\"noopener\">Artem Oppermann<\/a><\/figcaption>\n<\/figure>\n<p id=\"3626\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">We will be using Keras to build a CNN-based image classifier.<\/p>\n<p id=\"a7c6\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Keras is a user-friendly toolbox that substantially reduces the access hurdle to deep learning research and development. The Keras team purposefully incorporated the minimal entry barrier into its architecture to democratize machine learning. CNN, a subset of deep neural networks made up of several layers of artificial neurons, are frequently used to evaluate visual information.<\/p>\n<h1 id=\"9a29\" class=\"mq mr fr be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Keras<\/h1>\n<p id=\"e872\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\"><a class=\"af mp\" href=\"https:\/\/keras.io\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Keras<\/a>, an open-source, deep-learning library, was developed by Francois Chollet, a deep-learning researcher at Google. With Keras, users may rapidly translate code into a product because of its user-friendly design principles. This indicates that it was created following a set of criteria that aims to make it effective, dependable, and available to a broad audience. It has several uses in both business and academics as a result. It also offers comprehensive developer instructions.<\/p>\n<p id=\"6f8a\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Convolutional neural networks (<strong class=\"be ox\">CNNs<\/strong>) are a subtype of artificial neural networks that have been popular in several applications linked to computer vision and are attracting interest in other domains.<\/p>\n<p id=\"808c\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Convolution, pooling, and fully connected layers are just a few components that make up a convolutional neural network. Using a back propagation approach, it is designed to automatically and adaptively learn spatial hierarchies of features.<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fk fl fm fn fo\">\n<div class=\"ab ca\">\n<div class=\"ch bg ew ex ey ez\">\n<blockquote class=\"pm\"><p id=\"fc2f\" class=\"pn po fr be pp pq pr ps pt pu pv ok dw\" data-selectable-paragraph=\"\">Introducing the Comet AI art gallery \u2014 a public forum to log experiments, test different parameters, and share your AI-generated art! <a class=\"af mp\" href=\"https:\/\/www.comet.com\/site\/blog\/clipdraw-gallery-ai-art-powered-by-comet-and-gradio\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Learn more about our integration with Gradio to create this one-of-a-kind space<\/a>.<\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"fk fl fm fn fo\">\n<div class=\"ab ca\">\n<div class=\"ch bg ew ex ey ez\">\n<h2 id=\"8b15\" class=\"pw mr fr be ms px py pz mw qa qb qc na ny qd qe qf oc qg qh qi og qj qk ql qm bj\" data-selectable-paragraph=\"\">Prerequisites<\/h2>\n<p id=\"9599\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">To continue this article, we must install the following on our local machine.<\/p>\n<ul class=\"\">\n<li id=\"fea5\" class=\"no np fr be b nq ol ns nt nu om nw nx ny qn oa ob oc qo oe of og qp oi oj ok qq qr qs bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">Pandas<\/strong><\/li>\n<li id=\"9b44\" class=\"no np fr be b nq qt ns nt nu qu nw nx ny qv oa ob oc qw oe of og qx oi oj ok qq qr qs bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">Numpy<\/strong><\/li>\n<li id=\"1a0a\" class=\"no np fr be b nq qt ns nt nu qu nw nx ny qv oa ob oc qw oe of og qx oi oj ok qq qr qs bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">TensorFlow<\/strong><\/li>\n<li id=\"d745\" class=\"no np fr be b nq qt ns nt nu qu nw nx ny qv oa ob oc qw oe of og qx oi oj ok qq qr qs bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">Keras_tuner<\/strong><\/li>\n<li id=\"4530\" class=\"no np fr be b nq qt ns nt nu qu nw nx ny qv oa ob oc qw oe of og qx oi oj ok qq qr qs bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">Comet<\/strong><\/li>\n<\/ul>\n<p id=\"77a3\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">With that said, let us get started by importing important libraries. We will import Comet and the other libraries to log the important data as we proceed with the project.<\/p>\n<figure class=\"oz pa pb pc pd md\">\n<div class=\"aez ra l\">\n<pre>import pandas as pd\nimport numpy as np\nimport warnings\nimport matplotlib.pyplot as plt\n\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nimport keras_tuner as kt\n\nimport comet_ml<\/pre>\n<\/div>\n<\/figure>\n<p id=\"6281\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">The next thing to do in this stage is to ensure experiment reproducibility; we will set the seed value, and for our notebook that looks cleaner, turn off the warnings.<\/p>\n<pre class=\"oz pa pb pc pd rb rc rd bo re ba bj\"><span id=\"c35e\" class=\"rf mr fr rc b bf rg rh l ri rj\" data-selectable-paragraph=\"\">seed = <span class=\"hljs-number\">1842<\/span>\ntf.random.set_seed(seed)\nnp.random.seed(seed)\n\nwarnings.simplefilter(<span class=\"hljs-string\">'ignore'<\/span>)<\/span><\/pre>\n<h2 id=\"2297\" class=\"pw mr fr be ms px py pz mw qa qb qc na ny qd qe qf oc qg qh qi og qj qk ql qm bj\" data-selectable-paragraph=\"\">Data<\/h2>\n<p id=\"aa99\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">We will load the data into our notebook; the task is to create a machine-learning model to categorize pictures of the flower \u201c<strong class=\"be ox\">La Eterna.<\/strong>\u201d To get a baseline score, we shall employ a CNN model. Initial evaluation indicates that the dataset is small for a deep learning assignment. The <code class=\"cw rk rl rm rc b\">data_cleaned\/Train<\/code>subfolder contains the photos we use for training.<\/p>\n<pre>image_generator = ImageDataGenerator(rescale=1\/255, validation_split=0.2)\n\n#Train &amp; Validation Split\ntrain_dataset = image_generator.flow_from_directory(batch_size=32,\n                                                 directory='data_cleaned\/Train',\n                                                 shuffle=True,\n                                                 target_size=(224, 224),\n                                                 subset=\"training\",\n                                                 class_mode='categorical')\n\nvalidation_dataset = image_generator.flow_from_directory(batch_size=32,\n                                                 directory='data_cleaned\/Train',\n                                                 shuffle=True,\n                                                 target_size=(224, 224),\n                                                 subset=\"validation\",\n                                                 class_mode='categorical')\n\n#Organize data for our predictions\nimage_generator_prediction = ImageDataGenerator(rescale=1\/255)\nprediction_data = image_generator_prediction.flow_from_directory(\n                                                 directory='data_cleaned\/scraped_images',\n                                                 shuffle=False,\n                                                 target_size=(224, 224),\n                                                 class_mode=None)<\/pre>\n<p id=\"e971\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Let\u2019s plot flowers for the first batch:<\/p>\n<figure class=\"oz pa pb pc pd md\">\n<div class=\"qy ii l ee\">\n<div class=\"afb ra l\">\n<pre>batch_1_img = train_dataset[0]\nfor i in range(0,32):\n    img = batch_1_img[0][i]\n    lab = batch_1_img[1][i]\n    plt.imshow(img)\n    plt.title(lab)\n    plt.axis('off')\n    plt.show()<\/pre>\n<\/div>\n<\/div>\n<\/figure>\n<figure class=\"oz pa pb pc pd md lv lw paragraph-image\">\n<div class=\"me mf ee mg bg mh\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mi mj c\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*mFPalF0xvacGulpA8OJlfQ.png\" alt=\"Images of the train dataset\" width=\"700\" height=\"494\"><\/figure><div class=\"lv lw rn\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*mFPalF0xvacGulpA8OJlfQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*mFPalF0xvacGulpA8OJlfQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*mFPalF0xvacGulpA8OJlfQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*mFPalF0xvacGulpA8OJlfQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*mFPalF0xvacGulpA8OJlfQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*mFPalF0xvacGulpA8OJlfQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*mFPalF0xvacGulpA8OJlfQ.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*mFPalF0xvacGulpA8OJlfQ.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*mFPalF0xvacGulpA8OJlfQ.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*mFPalF0xvacGulpA8OJlfQ.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*mFPalF0xvacGulpA8OJlfQ.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*mFPalF0xvacGulpA8OJlfQ.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*mFPalF0xvacGulpA8OJlfQ.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*mFPalF0xvacGulpA8OJlfQ.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mk ml mm lv lw mn mo be b bf z dw\" data-selectable-paragraph=\"\">Images of the training dataset<\/figcaption>\n<\/figure>\n<p id=\"23b3\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">In order to capture a lot of valuable data about the experiments, such as the parameters, metrics and other important in this project, we have to start logging right here.<\/p>\n<pre class=\"oz pa pb pc pd rb rc rd bo re ba bj\"><span id=\"fc1f\" class=\"rf mr fr rc b bf rg rh l ri rj\" data-selectable-paragraph=\"\">experiment = comet_ml.Experiment(\n    api_key=<span class=\"hljs-string\">\"API-Key\"<\/span>,\n    project_name=<span class=\"hljs-string\">\"Project name\"<\/span>,\n    workspace=<span class=\"hljs-string\">\"Workspace name\"<\/span>,\n    log_code=<span class=\"hljs-literal\">True<\/span>)<\/span><\/pre>\n<p id=\"a15d\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">We used the Comet Experiment class, and we pass in the <code class=\"cw rk rl rm rc b\">api_key<\/code>, <code class=\"cw rk rl rm rc b\">project_name<\/code> , <code class=\"cw rk rl rm rc b\">workspace<\/code> and the <code class=\"cw rk rl rm rc b\">log_code<\/code> parameters.<\/p>\n<figure class=\"oz pa pb pc pd md\">\n<div class=\"afb ra l\">\n<pre>hyperparams = {\n    \"batch_size\": 32,\n    \"epochs\": 20,\n    \"num_nodes\": 64,\n    \"activation\": 'relu',\n    \"optimizer\": 'adam',\n}\nexperiment.log_parameters(hyperparams)<\/pre>\n<\/div>\n<figcaption class=\"mk ml mm lv lw mn mo be b bf z dw\">Model hyperparameters.<\/figcaption>\n<\/figure>\n<h2 id=\"c857\" class=\"pw mr fr be ms px py pz mw qa qb qc na ny qd qe qf oc qg qh qi og qj qk ql qm bj\" data-selectable-paragraph=\"\">Building the CNN<\/h2>\n<p id=\"072b\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">Building the CNN, we must be careful with input and output forms. This is the input shape: <strong class=\"be ox\">(224, 224, 3)<\/strong>. This indicates that the image\u2019s height, width, and channels are <strong class=\"be ox\">224<\/strong>, <strong class=\"be ox\">224<\/strong>, and <strong class=\"be ox\">3<\/strong>. Red, green, and blue are the three colour channels of a picture.<\/p>\n<figure class=\"oz pa pb pc pd md\">\n<div class=\"afc ra l\">\n<pre>model = keras.models.Sequential([\n    keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape = [224, 224,3]),\n    keras.layers.MaxPooling2D(),\n    keras.layers.Conv2D(64, (2, 2), activation='relu'),\n    keras.layers.MaxPooling2D(),\n    keras.layers.Conv2D(64, (2, 2), activation='relu'),\n    keras.layers.Flatten(),\n    keras.layers.Dense(100, activation='relu'),\n    keras.layers.Dense(2, activation ='softmax')\n])\n\n# print model summary\nprint(model.summary())<\/pre>\n<\/div>\n<\/figure>\n<figure class=\"oz pa pb pc pd md lv lw paragraph-image\">\n<div class=\"me mf ee mg bg mh\" tabindex=\"0\" role=\"button\">\n<figure><img loading=\"lazy\" decoding=\"async\" class=\"bg mi mj c\" role=\"presentation\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*iOf7nnGLygdZKCxHMGUC6g.png\" alt=\"\" width=\"700\" height=\"411\"><\/figure><div class=\"lv lw ro\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*iOf7nnGLygdZKCxHMGUC6g.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*iOf7nnGLygdZKCxHMGUC6g.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*iOf7nnGLygdZKCxHMGUC6g.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*iOf7nnGLygdZKCxHMGUC6g.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*iOf7nnGLygdZKCxHMGUC6g.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*iOf7nnGLygdZKCxHMGUC6g.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/format:webp\/1*iOf7nnGLygdZKCxHMGUC6g.png 1400w\" type=\"image\/webp\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\"><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*iOf7nnGLygdZKCxHMGUC6g.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*iOf7nnGLygdZKCxHMGUC6g.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*iOf7nnGLygdZKCxHMGUC6g.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*iOf7nnGLygdZKCxHMGUC6g.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*iOf7nnGLygdZKCxHMGUC6g.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*iOf7nnGLygdZKCxHMGUC6g.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*iOf7nnGLygdZKCxHMGUC6g.png 1400w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 700px\" data-testid=\"og\"><\/picture><\/div>\n<\/div>\n<figcaption class=\"mk ml mm lv lw mn mo be b bf z dw\" data-selectable-paragraph=\"\">CNN model summary.<\/figcaption>\n<\/figure>\n<p id=\"09af\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">The model is now ready for compilation. A callback is also being used to end the training early, so the callback will be activated when the validation loss has remained constant or increased for over three epochs.<\/p>\n<pre>model.compile(optimizer='adam',\n             loss = 'binary_crossentropy',\n             metrics=['accuracy'])\n\ncallback = keras.callbacks.EarlyStopping(monitor='val_loss',\n                                            patience=3,\n                                            restore_best_weights=True)<\/pre>\n<h2 id=\"0e9b\" class=\"pw mr fr be ms px py pz mw qa qb qc na ny qd qe qf oc qg qh qi og qj qk ql qm bj\" data-selectable-paragraph=\"\">Training the CNN<\/h2>\n<p id=\"c708\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">We will train our model with the training dataset from <code class=\"cw rk rl rm rc b\">data_cleaned\/Train<\/code> and set the epochs to <code class=\"cw rk rl rm rc b\">20<\/code>.<\/p>\n<pre class=\"oz pa pb pc pd rb rc rd bo re ba bj\"><span id=\"e56b\" class=\"rf mr fr rc b bf rg rh l ri rj\" data-selectable-paragraph=\"\">model.fit(train_dataset, epochs=<span class=\"hljs-number\">20<\/span>, validation_data=validation_dataset, callbacks=callback)<\/span><\/pre>\n<h2 id=\"3fbf\" class=\"pw mr fr be ms px py pz mw qa qb qc na ny qd qe qf oc qg qh qi og qj qk ql qm bj\" data-selectable-paragraph=\"\">Assessing the CNN performance<\/h2>\n<p id=\"65a0\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">We will evaluate our model&#8217;s performance by checking for loss and accuracy. Both loss and accuracy will be logged to Comet using <code class=\"cw rk rl rm rc b\">experiment.log_metric()<\/code> .<\/p>\n<pre class=\"oz pa pb pc pd rb rc rd bo re ba bj\"><span id=\"082b\" class=\"rf mr fr rc b bf rg rh l ri rj\" data-selectable-paragraph=\"\">loss, accuracy = model.evaluate(validation_dataset)\n<span class=\"hljs-built_in\">print<\/span>(<span class=\"hljs-string\">\"Loss: \"<\/span>, loss)\n<span class=\"hljs-built_in\">print<\/span>(<span class=\"hljs-string\">\"Accuracy: \"<\/span>, accuracy)\n\nexperiment.log_metric(<span class=\"hljs-string\">\"Loss\"<\/span>, loss, step=<span class=\"hljs-literal\">None<\/span>, include_context=<span class=\"hljs-literal\">True<\/span>)\nexperiment.log_metric(<span class=\"hljs-string\">\"Accuracy\"<\/span>, accuracy, step=<span class=\"hljs-literal\">None<\/span>, include_context=<span class=\"hljs-literal\">True<\/span>)<\/span><\/pre>\n<p id=\"3ac6\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Let\u2019s save the model.<\/p>\n<pre class=\"oz pa pb pc pd rb rc rd bo re ba bj\"><span id=\"f273\" class=\"rf mr fr rc b bf rg rh l ri rj\" data-selectable-paragraph=\"\">model.save(<span class=\"hljs-string\">'cnn-model'<\/span>)<\/span><\/pre>\n<p id=\"8179\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">A folder named <code class=\"cw rk rl rm rc b\">cnn-model<\/code> containing <code class=\"cw rk rl rm rc b\">assets<\/code>, <code class=\"cw rk rl rm rc b\">keras_metadata.pb<\/code>, <code class=\"cw rk rl rm rc b\">fingerprint.pb<\/code>, <code class=\"cw rk rl rm rc b\">saved_model.pb<\/code>, <code class=\"cw rk rl rm rc b\">variables<\/code> will be created in the project folder.<\/p>\n<h1 id=\"3408\" class=\"mq mr fr be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Logging the model<\/h1>\n<p id=\"c0ef\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">To finish this project, one thing left is to log the model and end the experiments to <a class=\"af mp\" href=\"https:\/\/www.comet.com\/site\/\" target=\"_blank\" rel=\"noopener ugc nofollow\">Comet<\/a>.<\/p>\n<pre class=\"oz pa pb pc pd rb rc rd bo re ba bj\"><span id=\"13e5\" class=\"rf mr fr rc b bf rg rh l ri rj\" data-selectable-paragraph=\"\"><span class=\"hljs-comment\"># log the model <\/span>\nexperiment.log_model(model, <span class=\"hljs-string\">'cnn-model'<\/span>)<\/span><\/pre>\n<p id=\"4116\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\"><strong class=\"be ox\">End the Experiment<\/strong><\/p>\n<pre class=\"oz pa pb pc pd rb rc rd bo re ba bj\"><span id=\"22fe\" class=\"rf mr fr rc b bf rg rh l ri rj\" data-selectable-paragraph=\"\"><span class=\"hljs-comment\">#end the experiment<\/span>\nexperiment.end()<\/span><\/pre>\n<p id=\"a419\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Always use the <code class=\"cw rk rl rm rc b\">experiment.end()<\/code> to end the experiment when running code on Colab or Jupyter notebook.<\/p>\n<p id=\"a662\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">And that is it; we have successfully logged our Keras deep learning experiments to <a class=\"af mp\" href=\"https:\/\/www.comet.com\/zenunicorn\/cnn-keras\/a3442a13d74c468d9d7d55091b7f4e74\" target=\"_blank\" rel=\"noopener ugc nofollow\">Comet<\/a>.<\/p>\n<figure class=\"oz pa pb pc pd md\">\n<div class=\"qy ii l ee\">\n<div class=\"rp ra l\"><iframe loading=\"lazy\" class=\"eo n ff dy bg\" title=\"\" src=\"https:\/\/cdn.embedly.com\/widgets\/media.html?src=https%3A%2F%2Fimgur.com%2Fa%2FwGfr3Nz%2Fembed%3Fpub%3Dtrue%26ref%3Dhttps%253A%252F%252Fembed.ly%26w%3D900&amp;display_name=Imgur&amp;url=https%3A%2F%2Fimgur.com%2Fa%2FwGfr3Nz&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=imgur\" width=\"900\" height=\"553\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<\/div>\n<\/figure>\n<h1 id=\"13aa\" class=\"mq mr fr be ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn bj\" data-selectable-paragraph=\"\">Conclusion<\/h1>\n<p id=\"be25\" class=\"pw-post-body-paragraph no np fr be b nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok fk bj\" data-selectable-paragraph=\"\">We have reached the end of this tutorial on logging Keras deep learning experiments to Comet. The logged experiment can be found in our <a class=\"af mp\" href=\"https:\/\/www.comet.com\/zenunicorn\/cnn-keras\/323df59e08224018b51b5366aba02b60\" target=\"_blank\" rel=\"noopener ugc nofollow\">dashboard<\/a>, and collaborators can be added to the project to view and improve. We covered what deep learning means, Keras, why we used Comet, and finally, we logged our experiments to Comet \u2014 an MLOps platform that enables us to track, compare and improve our experiments and models.<\/p>\n<p id=\"852b\" class=\"pw-post-body-paragraph no np fr be b nq ol ns nt nu om nw nx ny on oa ob oc oo oe of og op oi oj ok fk bj\" data-selectable-paragraph=\"\">Here is this <a class=\"af mp\" href=\"https:\/\/github.com\/zenUnicorn\/CNN-based-Image-Classfier-using-Keras\" target=\"_blank\" rel=\"noopener ugc nofollow\">link to my version of the notebook<\/a> (feel free to leave a star), as well as <a class=\"af mp\" href=\"https:\/\/www.kaggle.com\/code\/kenjee\/challenge-4-tutorial-3-neural-nets\" target=\"_blank\" rel=\"noopener ugc nofollow\">the original notebook by Ken Jee<\/a>. Also check out this amazing work by <a class=\"af mp\" href=\"https:\/\/www.milindsoorya.com\/blog\/how-to-build-a-simple-cnn-based-image-classifier-using-keras\" target=\"_blank\" rel=\"noopener ugc nofollow\">Milind Soorya<\/a> on a CNN-based image classifier.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Image by rawpixel.com on Freepik Overview Let us start by asking ourselves some questions: Have you ever wondered how Google\u2019s translation app can instantly convert entire paragraphs between two languages? How do Netflix and YouTube know what movies or videos we like, and how do they provide suitable recommendations? Or how do autonomous vehicles even [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"categories":[9,7],"tags":[],"coauthors":[143],"class_list":["post-8064","post","type-post","status-publish","format-standard","hentry","category-product","category-tutorials"],"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>How to Log Your Keras Deep Learning Experiments With Comet - Comet<\/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:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Log Your Keras Deep Learning Experiments With Comet\" \/>\n<meta property=\"og:description\" content=\"Image by rawpixel.com on Freepik Overview Let us start by asking ourselves some questions: Have you ever wondered how Google\u2019s translation app can instantly convert entire paragraphs between two languages? How do Netflix and YouTube know what movies or videos we like, and how do they provide suitable recommendations? Or how do autonomous vehicles even [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet\" \/>\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=\"2023-11-02T17:15:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-24T17:04:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*elTFp8dyQeoOPs3OSa2QxA.jpeg\" \/>\n<meta name=\"author\" content=\"Shittu Olumide Ayodeji\" \/>\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=\"Shittu Olumide Ayodeji\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Log Your Keras Deep Learning Experiments With Comet - Comet","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\/how-to-log-your-keras-deep-learning-experiments-with-comet","og_locale":"en_US","og_type":"article","og_title":"How to Log Your Keras Deep Learning Experiments With Comet","og_description":"Image by rawpixel.com on Freepik Overview Let us start by asking ourselves some questions: Have you ever wondered how Google\u2019s translation app can instantly convert entire paragraphs between two languages? How do Netflix and YouTube know what movies or videos we like, and how do they provide suitable recommendations? Or how do autonomous vehicles even [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2023-11-02T17:15:23+00:00","article_modified_time":"2025-04-24T17:04:59+00:00","og_image":[{"url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*elTFp8dyQeoOPs3OSa2QxA.jpeg","type":"","width":"","height":""}],"author":"Shittu Olumide Ayodeji","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Shittu Olumide Ayodeji","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet\/"},"author":{"name":"Team Comet Digital","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/6266601170c60a7a82b3e0043fbe8ddf"},"headline":"How to Log Your Keras Deep Learning Experiments With Comet","datePublished":"2023-11-02T17:15:23+00:00","dateModified":"2025-04-24T17:04:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet\/"},"wordCount":1089,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*elTFp8dyQeoOPs3OSa2QxA.jpeg","articleSection":["Product","Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet\/","url":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet","name":"How to Log Your Keras Deep Learning Experiments With Comet - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet#primaryimage"},"thumbnailUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*elTFp8dyQeoOPs3OSa2QxA.jpeg","datePublished":"2023-11-02T17:15:23+00:00","dateModified":"2025-04-24T17:04:59+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet#primaryimage","url":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*elTFp8dyQeoOPs3OSa2QxA.jpeg","contentUrl":"https:\/\/miro.medium.com\/v2\/resize:fit:700\/1*elTFp8dyQeoOPs3OSa2QxA.jpeg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/how-to-log-your-keras-deep-learning-experiments-with-comet#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"How to Log Your Keras Deep Learning Experiments With Comet"}]},{"@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\/6266601170c60a7a82b3e0043fbe8ddf","name":"Team Comet Digital","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/4f0c0a8cc7c0e87c636ff6a420a6647c","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/Screen-Shot-2023-08-12-at-8.58.50-AM-96x96.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2023\/08\/Screen-Shot-2023-08-12-at-8.58.50-AM-96x96.png","caption":"Team Comet Digital"},"sameAs":["https:\/\/www.comet.ml\/"],"url":"https:\/\/www.comet.com\/site\/blog\/author\/teamcometdigital\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/8064","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\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=8064"}],"version-history":[{"count":1,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/8064\/revisions"}],"predecessor-version":[{"id":15476,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/8064\/revisions\/15476"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=8064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=8064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=8064"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=8064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}