<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mwanikii on Medium]]></title>
        <description><![CDATA[Stories by Mwanikii on Medium]]></description>
        <link>https://medium.com/@freddynjagi?source=rss-a7870ab3194e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bVgCxJ1aw_b1jwEvT6nR3A.jpeg</url>
            <title>Stories by Mwanikii on Medium</title>
            <link>https://medium.com/@freddynjagi?source=rss-a7870ab3194e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:27:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@freddynjagi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Navigating Transfer Learning with Comet]]></title>
            <link>https://heartbeat.comet.ml/navigating-transfer-learning-with-comet-85aa52b2f944?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/85aa52b2f944</guid>
            <category><![CDATA[transfer-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[comet]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Wed, 13 Mar 2024 22:01:33 GMT</pubDate>
            <atom:updated>2024-03-13T22:01:33.953Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Comet to monitor pre-trained models</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3SgLgEnaaG9dFM96" /><figcaption>Photo by <a href="https://unsplash.com/@danielkorpai?utm_source=medium&amp;utm_medium=referral">Daniel Korpai</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Transfer learning involves using a pre-trained model to solve a deep-learning problem. If your problem is not necessarily unique, it is better to create a model that has already been trained on a given task.</p><p>Comet extensively integrates with multiple libraries, including the most common ones for deep learning, such as TensorFlow, Keras, and Pytorch.</p><p>These integrations are well-supported and allow extensive types of workflows, including those that require transfer learning. This article will dive deep into how you can make great observations and visualizations with Comet. I will also indicate how easy it is to integrate Comet with previous projects, as it takes a few lines of code here and there to get things running.</p><p>Now, for this task, you will need a few things:</p><ol><li>A Comet account. Sign up <a href="https://www.comet.com/signup">here</a>.</li><li>A Python 3.9+ install.</li><li>The following libraries: Comet, ScikitLearn, Pandas, and Keras.</li><li>A fierce learning spirit.</li></ol><p>Let&#39;s dive into the tiny project now.</p><h4>Project Overview</h4><p>In our tiny project, I will use one of my favorite datasets. The beauty of this dataset is that it has just the right amount of difficulty to ensure that you learn numerous concepts in a deep learning problem. We are going to be using data from Kaggle&#39;s famous <a href="https://www.kaggle.com/competitions/dogs-vs-cats-redux-kernels-edition/data">Cats-and-Dogs</a> problem.</p><p>The objective here is not to gain perfection or even high accuracy, as this is purely a learning exercise; hence, there are a few tradeoffs that I will highlight here.</p><p>We are going to build a simple, bare-bones model and train it only on a very small sample of the data we downloaded. The data will only be trained for a few epochs. From this, we can ascertain that there will be poor accuracy. It could be better with proper interventions, though.</p><p>Since that is established, let&#39;s code.</p><h3>Dataset Preparation</h3><p>We first store the information in the dataset in a Pandas DataFrame. The DataFrame will contain two columns: one for the file names and the other for each image&#39;s class.</p><pre>import pandas as pd<br>import os<br><br>train_dir = r&quot;./src/train_data&quot;<br><br>#path to training data<br>filenames = os.listdir(train_dir)<br><br>#separating cats from dogs<br>categories = []<br>for f_name in filenames:<br>    category = f_name.split(&#39;.&#39;)[0]<br>    if category == &#39;cat&#39;:<br>        categories.append(0)<br>    else:<br>        categories.append(1)<br><br>df = pd.DataFrame({<br>        &#39;filename&#39;: filenames,<br>        &#39;category&#39;: categories,<br>})<br><br>#replacing booleans with names<br>df[&quot;category&quot;] = df[&quot;category&quot;].replace({0:&#39;cat&#39;, 1:&#39;dog&#39;})<br><br>#storing info in csv files<br>df.to_csv(&quot;new_training_info.csv&quot;, index=False)</pre><p>After doing this, the table will look as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*XjPPuE7F2hFJA6OO4jpuEw.png" /><figcaption>Screenshot by author</figcaption></figure><h3>Parameter Definition</h3><p>We need to define a few parameters. One set will go into the model, while the other will be fed into the DataLoaders.</p><p>The parameters belonging to the model will be logged into Comet, allowing the training process to be monitored and properly visualized.</p><p>Our parameters will appear as below:</p><pre>img_height = 224<br>img_width = 224<br>img_channels = 3<br>img_size = (img_height, img_width)<br>train_dir = r&quot;./src/train_data&quot;<br>batch_size = 32</pre><p>The image fed into the model we will use will be 224 x 224 x 3 pixels, so all the images must be transformed into these sizes. The model will take batches of 32 images for training from the &quot;train_data&quot; directory.</p><h3>Initializing Comet and Data Generators</h3><p>Import the Comet library and initialize it by giving the project a name. This project will appear on your Comet home page. Most importantly, you will be requested to add an API key, which you can easily find on your account&#39;s &quot;Settings&quot; page.</p><pre>import comet_ml<br><br>comet_ml.init(project_name=&quot;transfer_learning_training&quot;)</pre><p>After pasting your API key, you will get the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*OtJLL0LeQ9IpOAMiVOuYNw.png" /><figcaption>Screenshot by author</figcaption></figure><p>The next step is to allow Comet to monitor our parameters. These parameters will be logged.</p><pre>from comet_ml import Experiment<br><br>#initializing comet experiment<br>experiment = Experiment()<br><br>parameters = {<br>    &quot;batch_size&quot;:batch_size,<br>    &quot;epochs&quot;: 5,<br>    &quot;optimizer&quot;: &quot;adam&quot;,<br>    &quot;loss&quot;: &quot;binary_crossentropy&quot;,<br>}<br>#Logging Parameters<br>experiment.log_parameters(parameters)</pre><p>We can now create data generators for our training and validation data fed into the models. Here, we will perform the necessary transformations on the images.</p><pre>from sklearn.model_selection import train_test_split<br>from keras.preprocessing.image import ImageDataGenerator<br><br><br>#Importing dataframe<br>df = pd.read_csv(&quot;new_training_info.csv&quot;)<br><br>#performing training and validation splits<br>train_df, validation_df = train_test_split(df,test_size=0.2, random_state=42)<br><br>#preparing data generators<br>train_datagen = ImageDataGenerator(rotation_range=15,<br>                                   rescale=1./255,<br>                                   shear_range=0.1,<br>                                   zoom_range=0.2,<br>                                   horizontal_flip=True,<br>                                   width_shift_range=0.1,<br>                                   height_shift_range=0.1)<br><br><br>train_gen = train_datagen.flow_from_dataframe(train_df, <br>                                              train_dir, x_col=&#39;filename&#39;, y_col=&#39;category&#39;,<br>                                              target_size=img_size,<br>                                              class_mode=&#39;binary&#39;,<br>                                              batch_size=batch_size)<br><br>validation_datagen = ImageDataGenerator(rescale=1./255)<br><br><br>validation_gen = validation_datagen.flow_from_dataframe(train_df, <br>                                              train_dir, x_col=&#39;filename&#39;, y_col=&#39;category&#39;,<br>                                              target_size=img_size,<br>                                              class_mode=&#39;binary&#39;,<br>                                              batch_size=batch_size)</pre><p>Now that that part is complete, we can use transfer learning using a pre-trained model.</p><h3>Transfer Learning</h3><p>We are going to use a ResNet50 as the base model, and we will add a few layers on top of it.</p><pre>#model creation and training<br>from keras.applications.resnet import ResNet50<br>from keras.layers import Dense, Flatten<br>from keras.models import Sequential<br>from keras.callbacks import EarlyStopping<br><br>#initialize sequential model<br>model = Sequential()<br><br>#base model<br>base = ResNet50(weights= &#39;imagenet&#39;,<br>                 include_top=False,<br>                 input_shape=(img_height, img_width, img_channels),<br>                 classes=2<br>                 )<br><br>for layer in base.layers:<br>    layer.trainable = False<br><br>#Adding layers to the model<br>model.add(base)<br>model.add(Flatten())<br>model.add(Dense(512, activation=&#39;relu&#39;))<br>model.add(Dense(1, activation=&#39;sigmoid&#39;))<br><br>#EarlyStopping callback<br>callback = EarlyStopping(monitor=&#39;loss&#39;,<br>                         patience=0)</pre><p>Above, we define our ResNet50 model and highlight the number of classes we train (only 2). We also specify the shape of the image that we want.</p><p>We will now compile the model and train it. Training will be recorded as a live event on your &quot;Project page&quot; in Comet. It will be indicated as complete once we run the &quot;experiment.end()&quot; function provided by Comet.</p><p>Let&#39;s first see the structure of our model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*zZ1hL9VUozlFh4_TXk4KiA.png" /><figcaption>Screenshot by author</figcaption></figure><p>The model can then be compiled using the parameters we initially logged to Comet.</p><pre>model.compile(loss=parameters[&quot;loss&quot;],<br>              optimizer=parameters[&quot;optimizer&quot;],<br>              metrics=[&quot;accuracy&quot;])</pre><p>We will do the same when training the model.</p><pre>#removing validation_steps and steps_per_epoch<br>model.fit_generator(train_gen,<br>                    validation_data = validation_gen,<br>                    epochs=parameters[&quot;epochs&quot;],<br>                    callbacks=[callback])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MYTYVXI4R6lsDxzsDlMYqQ.png" /><figcaption>Screenshot by author</figcaption></figure><p>Training occurs for five epochs, and now we can open our Comet &quot;Project&quot; page and check whether all the information we want has been logged and visualized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3Zvlqpfkh4v95YmZk49JQ.png" /><figcaption>Screenshot by author</figcaption></figure><p>We can see that our visualizations have been made. The loss and accuracy charts for the training and validation sets are available.</p><p>To end the run, one should add the line below:</p><pre>experiment.end()</pre><p>As shown above, Comet successfully logged the transfer learning run. However, it was fairly inaccurate, as I did not use various techniques to improve model performance. Some of the techniques that could be used to do this include data augmentation and resampling to give but a few examples.</p><p>Till we meet again!!</p><p><em>Editor&#39;s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We&#39;re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don&#39;t sell ads.</em></p><p><em>If you&#39;d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85aa52b2f944" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/navigating-transfer-learning-with-comet-85aa52b2f944">Navigating Transfer Learning with Comet</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Integrate Comet with Catboost Workflows]]></title>
            <link>https://heartbeat.comet.ml/how-to-integrate-comet-with-catboost-workflows-c69940afda2c?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c69940afda2c</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[gradient-boosting]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[catboost]]></category>
            <category><![CDATA[comet]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 23:02:15 GMT</pubDate>
            <atom:updated>2024-01-10T23:02:15.957Z</atom:updated>
            <content:encoded><![CDATA[<h4>Working around the lack of support with new features</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oygcvjT9V-Z9plzY" /><figcaption>Photo by <a href="https://unsplash.com/@campaign_creators?utm_source=medium&amp;utm_medium=referral">Campaign Creators</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Catboost is one of the most versatile gradient-boosting models. Its crucial capability is processing categorical data without converting it to numerical data. This means that the model can perform its function as you desire after specifying categorical data. An added benefit is that a data practitioner can easily and quickly establish a baseline with minimal data transformations.</p><p>Unfortunately, as you scroll through Comet’s supported libraries, you will discover the glaring lack of Catboost support. Fortunately, I have a clever but straightforward workaround leveraging Comet’s versatile capabilities.</p><p>Comet’s support for Tensorflow’s Tensorboard can become a saving grace for anyone using Catboost effectively with Comet. One integral feature of Catboost is that it uses Tensorboard to keep track of training runs and stores that information locally on the machine’s disk. Let’s look at the general workflow of performing this integration.</p><h4>Requirements</h4><p>There are a few things you need to install before you go through with this:<br>1. Catboost.</p><p>2. Comet’s official library.</p><p>3. A Comet account that you can get by signing up <a href="https://www.comet.com/site/">here</a>.</p><p>3. Visual Studio Code (or any IDE that supports Tensorboard Integration).</p><p>With the above, it is now possible to proceed.</p><h4>Catboost Integration with Tensorboard</h4><p>Catboost integrates with Tensorboard to ensure we can adequately visualize training runs. It indicates the desired metric that one has specified during the training run, graphs it, and allows for customization. The picture below is an excellent example of what I am talking about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yN2vTIsWSEFta4kMMWRuvQ.png" /><figcaption>Tensorboard for Catboost, screenshot by author</figcaption></figure><p>An added advantage of this library is that it stores the information in a local directory or a directory you initially specified before the training run, as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/179/1*zOJry_8V3qmKkJ5_eYBoIg.png" /><figcaption>Catboost directory by author</figcaption></figure><p>In this article, we use this feature to our advantage as Comet allows us to upload this information and create a custom panel to have a clear view of the given data. Despite the lack of support for this library, we see that the support for TensorFlow’s Tensorboard gives us an added advantage because we can leverage a single aspect of the Catboost library and upload critical information through an existing Comet function.</p><p>Let’s code!</p><h4>Simple Project</h4><p>Our simple project here will only focus on the capabilities Catboost, Tensorboard, and Comet offer. All data transformation has already been done, so we have a reasonably clean dataset that will be fed into the model.</p><p>The dataset of our choice is the Bengaluru House Prediction Dataset from <a href="https://machinehack.com/hackathons/predicting_house_prices_in_bengaluru/overview">Machinehack</a>. This competition aims to test your skills in regression problems. We can now check our preprocessed data with Pandas to have a general overview of our data.</p><pre>import pandas as pd<br><br>#reading data in local directory<br>df = pd.read_csv(&quot;preprocessed_train_data.csv&quot;)<br><br>#defining features(X) and targets(y)<br>X = df.drop([&quot;price&quot;], axis=1)<br>y = df[&quot;price&quot;]<br><br>#printing the top 5 positions of X and y<br>print(X.head())<br>print(y.head())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HGq438y7_iKJqffXQxMgg.png" /><figcaption>X data by author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*3cb3BQZv6a4CDPrOzpWdMQ.png" /><figcaption>y data by author</figcaption></figure><p>Now that we have seen our myriad of features (including one categorical one), we can incorporate this into Comet.</p><h4>Comet Incorporation</h4><p>Note: Import the Comet library first and initialize the project before proceeding with any other code for a smoother way forward.</p><p>First, import the Comet library and initialize our project under the name “catboost_comet.”</p><pre>import comet_ml<br>comet_ml.init(project_name=&quot;catboost_comet&quot;)</pre><p>We then define our categorical features and perform train-validation splits for the training of our model. Catboost requires a user to specify the categorical features that a dataset has.</p><pre>from sklearn.model_selection import train_test_split<br>import numpy as np<br><br>#defining categorical features<br>categorical_features_indices = np.where(X.dtypes !=np.float)[0]<br><br>#Train-test split<br>X_train, X_validation, y_train, y_validation = train_test_split(X, y, train_size = 0.8, random_state = 12)<br></pre><p>Now, we can feed the above information into Catboost’s regressor and perform training.</p><pre>from catboost import CatBoostRegressor<br><br>#defining model params<br>model  = CatBoostRegressor(iterations=50, depth=3, learning_rate=0.1, loss_function=&#39;RMSE&#39;, early_stopping_rounds=5)<br><br>#training model on data<br>model.fit(X_train, y_train, cat_features=categorical_features_indices, eval_set=(X_validation, y_validation), plot=True)<br><br>#performing inference<br>y_valid = model.predict(X_validation)<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgOSVotYGMPATOPv1loaWw.png" /><figcaption>Training run and results by author</figcaption></figure><p>After this run, there is the expectation that information on the training run will be stored in a folder for the Tensorboard to perform a visualization. This folder will be within the project’s directory. We can extract two files containing the critical info we need from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/162/1*xRTWBgHgWevTop-fzHz5_Q.png" /><figcaption>Local directory by author</figcaption></figure><p>Within the “catboost_info” directory, we will find the “learn_error.tsv” and “test_error.tsv” files. We shall log these files into Comet using “log_table().”</p><pre>#logging both tables to Comet<br>experiment.log_table(&quot;./src/catboost_info/learn_error.tsv&quot;)<br>experiment.log_table(&quot;./src/catboost_info/test_error.tsv&quot;)</pre><p>Once those are complete, we can end the experiment and open Comet to see whether it was successful.</p><pre>#Ending experiment<br>experiment.end()</pre><h4>Comet Visualization</h4><p>Once we open our Comet project page, we will find and open our project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*zQ6lwqbENHj_FgVudzb0aA.png" /><figcaption>Project image by author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LP7lAP1e2HK67zPz1bHJkQ.png" /><figcaption>Screenshot of project by author</figcaption></figure><p>After pressing the prominent blue button in the middle, you will get the menu below and pick “Data Panel.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9iT8WUSSbRCQdfaNeSrbOQ.png" /><figcaption>Comet Menu by author</figcaption></figure><p>After opening that menu, we will find a drop-down menu called “Data Selection,” where we will see the two tables we initially uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*cQEqdwaMnwRNVHI0GiTudA.png" /><figcaption>Screenshot by author</figcaption></figure><p>We then pick the first table, and it will give a preview of the data. After we press it, it will appear on the original page with no panels, as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJNHHfiRjgWmEVK8r9qtAQ.png" /><figcaption>Screenshot by author.</figcaption></figure><p>When we press “Add” in the top right corner, we see the option to add another panel, and then we can repeat the process for the other table that we logged in.</p><p>We finally have logged information concerning a Catboost training run using Comet’s support for the Tensorboard. In this tutorial, we have successfully integrated a library that Comet does not officially support.</p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c69940afda2c" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/how-to-integrate-comet-with-catboost-workflows-c69940afda2c">How to Integrate Comet with Catboost Workflows</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Artificial Intelligence on Mobile Devices]]></title>
            <link>https://heartbeat.comet.ml/artificial-intelligence-on-mobile-devices-e570fb99a9d4?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e570fb99a9d4</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[quantization]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[edge-computing]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Mon, 04 Dec 2023 14:40:35 GMT</pubDate>
            <atom:updated>2023-12-04T14:40:35.281Z</atom:updated>
            <content:encoded><![CDATA[<h4>The challenges and successes involved in bringing AI to your palm</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KhLkjEd-ebS_jnBw" /><figcaption>Photo by <a href="https://unsplash.com/@neilsoniphotography?utm_source=medium&amp;utm_medium=referral">Neil Soni</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The proliferation of machine learning and deep learning algorithms has been ubiquitous and has not left any device with an ounce of processing power behind, even our smartphones.</p><p>This development can largely be attributed to the increased power that our mobile phones have and a strong desire by consumers to have better features. Hardware has seen a dramatic performance improvement, and software has grown to match these capabilities. Better photographs, recommendation systems, text prediction, and other features have become a staple in even the simplest of modern smartphones. This drives me to ask what challenges existed to deliver this seemingly unreachable dream to us?</p><p>Let’s look at the hardware and software strides necessary to make this leap in progress.</p><h3>Deep Learning Architectures and Workarounds</h3><p>Implementing deep learning architectures involves numerous stages, including training data, training the model, inference, and model evaluation.</p><p>The above steps are critical for any deep learning model to succeed, but one quickly hits a constraint wall when you attempt to train these models on hardware found on a smartphone. Trying to train a model on potentially gigabytes or terabytes of data becomes an impossible hill to climb.</p><p>For the above reasons, engineers and developers developed clever workarounds that leverage existing deep learning solutions to the problem. Some of these solutions are commonly used in other domains.</p><h4>Efficient Architectures and Pretrained Models</h4><p>One of the most formidable ways to deal with hardware shortcomings is using efficient architectures. These architectures are designed to use smaller processing capacity to be accurate.</p><p>Some of the architectures that fall under this category are MobileNet and ShuffleNet. Howard et al. describe that they “introduce two simple global hyperparameters that allow the model builder to choose the right sized model for their application based on the constraints of the problem [1].”</p><p>These models make inevitable tradeoffs but can still perform exceedingly well on tasks such as facial recognition, object detection, and other domains on mobile phones.</p><p>We can move on to the next domain, as many of these models are in the common domain.</p><h4>Transfer Learning</h4><p>Existing implementations of these models allow developers to deploy them on mobile devices as they deem fit for any given purpose.</p><p>Transfer learning involves using an already-trained model to improve the performance of a new model. Rather than coming up with an implementation that might be inefficient and less capable than is already possible, why not use a proven method?</p><p>APIs such as Keras allow the democratization of these models, and they are even encouraged to be used as they will likely improve the outcome of these efficient architectures.</p><h4>Smaller Models for Smaller Machines</h4><p>So far, we might have noticed a pattern that indicates that smaller is preferable for hardware with lower capacity. The above techniques do a phenomenal job of allowing models to perform well. Still, they do not represent the struggle to ensure deep learning models perform optimally on mobile devices.</p><p>Additional integral techniques include pruning, quantization, and distillation, among others. The advent of LLMs has brought some of these techniques, primarily quantization, to the limelight. We’ll dive into these techniques.</p><p>The simplest definition of pruning is that it reduces the parameters in a neural network. It sounds unintuitive but tactfully minimizes the amount of storage a model requires while maintaining good enough performance for a given task (such as image recognition). However, going further than is needed reasonably leads to a reduction in the performance of a model.</p><p>Quantization can be defined as a precision-reducing process that also aims to reduce the amount of memory or storage required for a model. This is done by changing floating point numbers (float data types) to integers (e.g., a float32 to an int8). It uses less memory and has higher efficiency.</p><p>The above is a highly simplified explanation of the standard software techniques in building models for devices with comparably smaller processing power. Fortunately, interventions are not limited to the software domain as robust hardware solutions have steadily risen since the necessity arose.</p><h4>Hardware Interventions</h4><p>Phones and other mobile devices have increasingly come to encompass the staples integral to our other computing devices. One of the most important aspects of deep learning is the hardware required to run it. GPUs are essential as their architecture is perfect for running deep learning models.</p><p>GPUs and Neural Processing Units are highly specialized hardware, and they perform the computations necessary in combination with the software mentioned above interventions. Lite versions of deep-learning libraries are also dedicated and optimized to run exclusively on this class of efficient machinery.</p><p>Building deep learning models is difficult despite the advances made to make them accessible. Phones and other mobile devices have become more powerful as the need to leverage more processing power for consumer devices has gained traction. For this reason, multiple software, hardware, and even off-machine solutions such as cloud computing have been made a staple.</p><p>Deeper research into these hardware and software interventions will increase the possibilities of phones and other mobile devices.</p><p>Source:</p><p>[1] Howard, Andrew G., Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. “Mobilenets: Efficient convolutional neural networks for mobile vision applications.” <em>arXiv preprint arXiv:1704.04861</em> (2017).</p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e570fb99a9d4" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/artificial-intelligence-on-mobile-devices-e570fb99a9d4">Artificial Intelligence on Mobile Devices</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using XGBoost for Deep Learning]]></title>
            <link>https://heartbeat.comet.ml/using-xgboost-for-deep-learning-8b2b23b50f8f?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b2b23b50f8f</guid>
            <category><![CDATA[convolutional-neural-net]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[xgboost]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 16:15:22 GMT</pubDate>
            <atom:updated>2023-11-14T16:15:22.580Z</atom:updated>
            <content:encoded><![CDATA[<h4>Integrating XGboost with Convolutional Neural Networks</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AOtq4ZS_nATb4CfH" /><figcaption>Photo by <a href="https://unsplash.com/es/@sharonmccutcheon?utm_source=medium&amp;utm_medium=referral">Alexander Grey</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>XGBoost is a powerful library that performs gradient boosting. It has an excellent reputation as a tool for predicting many kinds of problems in data science and machine learning. It is also used in regression and classification problems as it is highly intuitive and easily interpretable.</p><p>One good indicator of how powerful XGBoost is is the number of winning solutions that utilize this model on Kaggle. For many years, gradient-boosting models and deep-learning solutions have won the lion&#39;s share of Kaggle competitions.</p><p>Using XGBoost can quickly help you get from start to finish of a project with minimal initial feature engineering.</p><p>One robust use case for XGBoost is integrating it with neural networks to perform a given task. XGBoost is not limited to machine learning tasks, as its incredible power can be harnessed when harmonized with deep learning algorithms.</p><p>We can now focus on how to approach XGBoost from a deep learning standpoint and even leverage technical information on building the architecture we aim to leverage.</p><p>First of all, to implement this, we need to be familiar with the libraries that contain our model:</p><ol><li>XGBoost</li><li>Tensorflow and Keras</li></ol><p>All the above libraries can be installed by checking on their official sites. For clarity, Tensorflow and Pytorch can be used for building neural networks.</p><h3>ConvXGB Introduction</h3><p>ConvXGB is a model that incorporates both Convolutional Neural Networks and XGBoost. It was envisioned by Thongsuwan et al., who found inherent advantages to the architecture and highlighted a few shortcomings by trying to leverage each model individually. Still, there was an excellent way to look at this:</p><ol><li>Using XGBoost is &quot;still unclear for feature learning [1].&quot;</li><li>Integrating Convolutional Neural Networks provides the added benefit of better feature learning, eliminating the shortcoming of XGBoost.</li></ol><p>The process above is standard, as practitioners often combine models in different ways for better performance. ConvXGB explores this but with a few exciting caveats that the researchers included. The Convolutional Neural Network&#39;s architecture differs slightly from the usual architecture.</p><p>We can now explore ConvXGB&#39;s architecture and look keenly at this model&#39;s nitty-gritty details.</p><h3>Architecture</h3><p>This model&#39;s architecture is categorized into two sections: The feature learner and the class predictor. Both sections are further subdivided into the critical steps to implement this model successfully.</p><p>The feature learning section has an input section and a data preprocessing section. The idea behind this is that it&#39;s necessary to have data in the appropriate form to be ingested by the convolutional neural network. For data that is not in a tuple or Numpy array form, the data preprocessing layer is responsible for performing this conversion. If you aren&#39;t familiar with this step, check out my<a href="https://medium.com/cometheartbeat/understanding-memory-mapping-in-numpy-for-deep-learning-pt-1-2bfa8319f79b"> articles</a> discussing Numpy arrays and the constraints that you may experience dealing with them.</p><p>The convolutional neural network has some exciting features that are not typical of the average CNN. Thongsuwan et al. hypothesized that reducing parameters would reduce simplicity for a few reasons. This would happen by not including a fully connected layer and pooling layers because &quot;it is not necessary to bring weights from the FC layers back to re-adjust weights in the previous layers [1].&quot;</p><p>Now, the data can be fed into the predicting section of the model. This section consists of three parts: the reshaping layer, the class prediction layer, and the output layer.</p><h3>Benefits and Drawbacks</h3><p>This architecture has several benefits, as the paper&#39;s writers demonstrated, but they have shortcomings.</p><p>One of the most impressive benefits of this architecture is how well it performs against other similar algorithms. In many of the benchmarks in the paper, the ConvXGB architecture outperformed other similar models.</p><p>Despite the excellent performance, there were a few drawbacks. For instance, one has to get the number of convolution layers right, as coming up with too many may increase the architecture&#39;s computational cost. The authors admit that it might &quot;outweigh any advantage, and we must balance carefully any increase in accuracy with the cost incurred [1].&quot;</p><h3>Conclusion</h3><p>The ConvXGB is a powerful model that combines the power of XGBoost with deep learning. Its simplicity and ease of implementation allow for inference and strong performance if implemented correctly.</p><p>In our next article, we can try an implementation of the model.</p><h3>Sources:</h3><p>[1]Thongsuwan, Setthanun, Saichon Jaiyen, Anantachai Padcharoen, and Praveen Agarwal. &quot;ConvXGB: A new deep learning model for classification problems based on CNN and XGBoost.&quot; <em>Nuclear Engineering and Technology</em> 53, no. 2 (2021): 522–531.</p><p><em>Editor&#39;s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We&#39;re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don&#39;t sell ads.</em></p><p><em>If you&#39;d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b2b23b50f8f" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/using-xgboost-for-deep-learning-8b2b23b50f8f">Using XGBoost for Deep Learning</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Memory Mapping in Numpy for Deep Learning: Pt 2]]></title>
            <link>https://heartbeat.comet.ml/understanding-memory-mapping-in-numpy-for-deep-learning-pt-2-5bd1d5bc61f9?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bd1d5bc61f9</guid>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[memory-management]]></category>
            <category><![CDATA[numpy-array]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Tue, 03 Oct 2023 14:13:48 GMT</pubDate>
            <atom:updated>2023-10-03T14:13:48.150Z</atom:updated>
            <content:encoded><![CDATA[<h4>Getting familiar with memmap()</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gcMbHjSPWJ98QaVm" /><figcaption>Photo by <a href="https://unsplash.com/@helibertoarias?utm_source=medium&amp;utm_medium=referral">Heliberto Arias</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the <a href="https://heartbeat.comet.ml/understanding-memory-mapping-in-numpy-for-deep-learning-pt-1-2bfa8319f79b">previous article</a>, we demonstrated the benefits and ease with which someone could integrate memory mapping into their workflow. A simple overview is that memory mapping allows an individual to occupy a small amount of memory rather than loading an entire array or object.</p><p>Numpy offers multiple solutions for any given problem, and we explored memory mapping using the “mmap_mode” argument presented in Numpy’s “load().” The difference is that now we will look at Numpy’s other solution.</p><p>When there may be a need for further capacity to manipulate values and leverage more tools when doing memory mapping, the go-to solution would be Numpy’s “memmap().”</p><p>Let’s get to it.</p><h3>A Brief Intro</h3><p>One of the first realizations you encounter with memmap is that it will not be as straightforward as you may have assumed. The documentation provides an intricate web of warnings on how to use it, and you quickly learn why.</p><p>For instance, a simple documentation scan mentions that you “must specify shape” as the array will be provided as a 1-dimensional array by default. One way we can do this is by taking the binary with information of an “X_train” array in the previous article.</p><pre>import numpy as np<br><br>X_train = np.load(&quot;X_train.npy&quot;, mmap_mode=&#39;r&#39;)<br><br>print(X_train.shape)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*HSausR1kz5OSb4dQ7OjdHw.png" /><figcaption>Array shape screenshot by the author</figcaption></figure><p>Attempting the same thing using memmap will yield a dramatically different result that aligns with the warning aired in the documentation.</p><pre>X_train = np.memmap(&quot;X_train.npy&quot;, mode = &#39;r&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*e8ObCs6wp8FFjcywMgMWKg.png" /><figcaption>Array shape screenshot by the author</figcaption></figure><p>The value above is truly a 1-dimensional array with many elements, as indicated by a lack of values trailing the comma.</p><p>But can we fix this and load the values appropriately? What points are vital and need consideration when using memmap? We can now answer these questions by paying attention to the tiny details a person could easily miss.</p><h4>Binary Formats and Arguments</h4><p>In the example above, I attempted to use a binary in NumPy format. Even after trying the appropriate method of loading the binary, I still could not get the proper elements out of it.</p><p>By visual inspection, we see many floats when we use the “load” method, but that doesn’t happen when using “memmap.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*6FWh2ltX3787u2d6LlCtYQ.png" /><figcaption>Array section using “Load” by author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/1*-qX8LyQhv-3jfrDd7cOlqw.png" /><figcaption>Array section using “memmap”</figcaption></figure><p>As seen above, one gives an array of floats while the other offers an array of integers. We will still get different values even if we try assigning a float type in memmap using the data type argument(dtype=).</p><p>One of the reasons we are running into these issues is because of the binary file format we use. We are using Numpy binaries and expecting that they will work perfectly, yet “memmap()” requires us to use different formats, such as the Raw Binary Format (RBF).</p><p>We can convert the Numpy array we loaded earlier into a Raw Binary Format and attempt memory mapping the array.</p><pre>import numpy as np<br><br>#remember we loaded X_train using &quot;load()&quot; previously <br><br>X_train.tofile(&quot;X_train_raw.rbf&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/110/1*16pWV-F-8POuVipsOx4VAw.png" /><figcaption>Screenshot of the above file by author</figcaption></figure><p>The binary file created above is smaller than the original Numpy binary by a few hundred megabytes. Will it mean a smaller memory occupation? We will investigate later.</p><p>Now, we can attempt memory mapping with the lessons we acquired:</p><ol><li>Pay attention to shape.</li><li>Specify data type.</li><li>Mode — Whether it is read-only(r), read and write(r+) etc.</li></ol><h3>Memory Mapping</h3><p>We are going to name the variable that will store the memory-mapped array “X_train_mapped.”</p><pre>#Using memmap to memory map the binary<br><br>X_train_mapped = np.memmap(&quot;X_train_raw.rbf&quot;, <br>                            shape=(4002, 120, 120, 3), <br>                            mode = &#39;r&#39;,<br>                            dtype = &#39;float64&#39;)<br><br>#printing the first element of the stored array<br>print(X_train_mapped[0])</pre><p>Now that all arguments are theoretically in the appropriate form, we can run the code and see if the first element is what we desire.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*hD8a-YbrieGC1rovAzEYFg.png" /><figcaption>Screenshot by author</figcaption></figure><p>Now, it is identical to the information we had initially stored. The data looks precisely as it was meant to because we have used the correct binary format, the appropriate shape, and, most importantly, the correct data type.</p><p>Since it works, we can now explore the question of memory.</p><h3>Memory Usage</h3><p>Is there any inherent advantage when using this particular method? In the previous article, we highlighted that a 1.4 GB file only occupied 184 bytes after being memory-mapped.</p><p>In this article, we created and stored a raw binary from that same file. It occupies 805.4 MB. Now, we can check how much space it will take on the memory using the “sys” library.</p><pre>import sys<br><br>#getting the amount of memory occupied by X_train_mapped<br>print(f&#39;X_train_mapped memory occupied: {sys.getsizeof(X_train_mapped)} bytes&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*R2Z6jK_dgblSWc7hp_Kx4Q.png" /><figcaption>Screenshot by author</figcaption></figure><p>Well, we can see no change in the amount of memory occupied. It is still 184 bytes, which is still impressive, to say the least.</p><p>I believe that we now have a comprehensive understanding of both “load()” and “memmap()” for the tasks we need to use them for. A simple overview of what we did would be as follows for those who want to use memmap():</p><ol><li>Store arrays in Raw Binary Format.</li><li>Ensure you know the array’s shape to write in the “shape” argument.</li><li>Specify the mode you desire to load the array in.</li><li>Make sure that the datatype argument has the correct datatype.</li></ol><h3>Conclusion</h3><p>This is the end of the two-part series on memory mapping, where I have given a comprehensive beginner tutorial on the best method for a deep learning dive. These methods are not limited to deep learning as we have acquired an understanding of binaries and how they could be used to store information.</p><p>Adios! Til we meet again in the next tutorial. Code away.</p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bd1d5bc61f9" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/understanding-memory-mapping-in-numpy-for-deep-learning-pt-2-5bd1d5bc61f9">Understanding Memory Mapping in Numpy for Deep Learning: Pt 2</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Memory Mapping in Numpy for Deep Learning: Pt 1]]></title>
            <link>https://heartbeat.comet.ml/understanding-memory-mapping-in-numpy-for-deep-learning-pt-1-2bfa8319f79b?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bfa8319f79b</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[numpy-array]]></category>
            <category><![CDATA[memory-management]]></category>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Wed, 27 Sep 2023 12:06:57 GMT</pubDate>
            <atom:updated>2023-09-27T12:06:57.670Z</atom:updated>
            <content:encoded><![CDATA[<h4>Dealing with your memory constraints</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v1ps6vVnMykXbtMS" /><figcaption>Photo by <a href="https://unsplash.com/@iantalmacs?utm_source=medium&amp;utm_medium=referral">Ian Talmacs</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the previous <a href="https://medium.com/cometheartbeat/understanding-memory-constraints-in-image-classification-637e5136dee2">article</a>, we discussed the possibility of having memory constraints when trying to get into deep learning. I mentioned Numpy’s memory mapping; in this article, we go deeper into the topic and offer an excellent guide to get you started.</p><p>There might be a question about why Numpy memory mapping is necessary and who the target demographic is for this particular technique. Now, we can dive into the nitty-gritty details.</p><h3>Memory-Mapping</h3><p>Numpy describes its memory mapping feature as accessing small segments of a file without loading the entire file into memory.</p><p>This feature highlights the existence of a memory shortage problem for some people. When working with deep learning, arrays might become larger than what could fit in memory. This spells out a problem as it will prevent the computer from running as intended.</p><p>Memory mapping will favor someone with access to ample storage compared to memory size (which is often the case). The first step is to save the array as a Numpy binary. Then, from that point onwards, we will load it via memory mapping and perform any operations we deem fit.</p><h3>Saving Binaries</h3><p>A binary can easily be described as a file format used to store information. Storing arrays in binaries is convenient as it means you don’t have to waste precious time trying to remake the array whenever you want to return to a problem. A binary allows for easy retrieval of this information whenever needed.</p><p>Numpy offers “save()” and “savez()” when you want to save binaries. This functionality is often easy to work with as it has few parameters. You must describe the binary’s path and the array to be stored in binary format. If you have no other needs, then you’re good to go.</p><p>For example, if you have an array that stores image data such as training data(X_train and y_train) and you want to store it, you would do the following:</p><pre>#Splitting training data for image into X and y<br>X_train = []<br>y_train = []<br><br>for features, labels in training_data:<br>    X_train.append(features)<br>    y_train.append(labels)<br><br>#Saving into a binary<br>from numpy import save<br><br>save(&quot;X_train.npy&quot;, X_train)<br>save(&quot;y_train.npy&quot;, y_train)</pre><p>The above code snippet will save one binary each for the X_train array and the y_train array, respectively.</p><p>Once the binary file is saved, there are multiple ways to load the file into memory to perform operations. The standard method involves just loading them as they are into memory. The second way requires memory mapping.</p><h3>Loading Binaries</h3><p>Numpy offers a few tools to load binaries as desired. The first method is by using “load()” while the second is using “memmap().” There are advantages and disadvantages to using each one.</p><p>The first method allows someone to use memory mapping or load directly, as efficiently and fluidly as possible. The only difference is an argument away.</p><p>I made two binary files to perform this example and to show how load() works. The first binary is a 1.4 GB file we will memory map, and the second is a 32 KB file that will be entirely loaded into memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*3fXTHyCipxsBO61o2szbLw.png" /><figcaption>Screenshot by Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*U3d4J6draqQ0hYUBJuXelQ.png" /><figcaption>Screenshot by Author</figcaption></figure><pre>from numpy import load<br><br>#Load binary as y_train<br>y_train = load(&quot;y_train.npy)</pre><p>Running the above code will call the entirety of y_train into memory, and we can check this using the “sys” library. We expect it to occupy a memory amount similar to the storage size.</p><pre>import sys<br><br>#checking the size of the file in memory<br>print(f&#39;y_train memory occupied: {sys.getsizeof(y_train)} bytes&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*L4G9Jlk5qjY76JAmcp_CEg.png" /><figcaption>Screenshot by Author</figcaption></figure><p>It has occupied 32 KB, as we expected it to. We have demonstrated what loading into memory does and expect it to behave similarly if a different, larger file is loaded. This is where our memory mapping comes into the picture, as we can load a smaller amount of content into memory.</p><p>The “X_train” file is 1.4 GB, but only a tiny fraction of the memory will be occupied when we alter the code we wrote.</p><pre>from numpy import load<br>import sys<br><br>#Loads the X_train.npy <br>X_train = load(&quot;X_train.npy&quot;, mmap_mode=&#39;r&#39;)</pre><p>Here, we include the “mmap_mode” argument and choose “r” as our preferred mode. It refers to read-only and is one of four modes that are offered. All the modes are as defined below in the Numpy documentation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*nOZRUmBPil7PT5fXzzXR5A.png" /><figcaption>Courtesy of <a href="https://numpy.org/doc/stable/reference/generated/numpy.memmap.html">Numpy</a></figcaption></figure><p>Now, we can perform a similar test to the previous one and check how much memory X_train will use after using the memory-mapped mode.</p><pre>print(f&#39;X_train memory occupied: {sys.getsizeof(X_train)} bytes&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*5flRpo5wT7hILesfcWhYmg.png" /><figcaption>Screenshot by Author</figcaption></figure><p>Impressively enough, our much larger file now occupies significantly less memory when memory-mapped. It only occupies 184 bytes but remains in a format that could be used for tasks such as training models or tasks like predicting labels without much additional overhead.</p><pre>#model fitting will work just as usual with memory-mapped variables<br><br>model.fit(X_train, y_train)<br><br>#predicting will also similarly be the same<br>y_predict = model.predict(X_test)</pre><h3>Disclaimer</h3><p>This method is not a magic bullet for all your problems, as there are a few things to remember when using memory mapping.</p><p>One consideration is whether you want to operate on the loaded binary. If you desire to work on the memory-mapped file, it will become an array and occupy the memory you set out to save. It is, therefore, advisable to split the data into slices to iterate on any given operation.</p><p>Another consideration is the modes offered when using “mmap_mode()”. If the binary needs changes, then the appropriate mode may not be the default mode that only supports read-only.</p><h3>Wrap Up…</h3><p>Memory mapping is a great way to save memory when performing operations that may occupy a lot of space. In this article, we learned how to use Numpy’s “load()” to load things entirely into the memory and how to perform memory mapping.</p><p>Numpy also offers “memmap()” for this particular job, but it has different dynamics that we will explore in the second part of this article.</p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bfa8319f79b" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/understanding-memory-mapping-in-numpy-for-deep-learning-pt-1-2bfa8319f79b">Understanding Memory Mapping in Numpy for Deep Learning: Pt 1</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Balanced Overview of Kangas Features]]></title>
            <link>https://heartbeat.comet.ml/a-balanced-overview-of-kangas-features-d34e26fe6012?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d34e26fe6012</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[kanga]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Mon, 07 Aug 2023 15:01:34 GMT</pubDate>
            <atom:updated>2023-08-07T15:01:34.490Z</atom:updated>
            <content:encoded><![CDATA[<h4>The good and the stuff that could be better</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NMoEC2tgTFmTGEvI" /><figcaption>Photo by <a href="https://unsplash.com/@mannydream?utm_source=medium&amp;utm_medium=referral">Manny Moreno</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Kangas is a data exploration tool, and its official Github page describes it as a “tool for exploring, analyzing, and visualizing large-scale multimedia data.”</p><p>This statement might serve its purpose only if you pay attention. It is easy to misconstrue the platform’s purpose in its current form, but there are practical ways to show what Kangas is capable of and what it could improve on.</p><p>Now we can get to the good stuff.</p><h4>Familiar API</h4><p>One of the most intimidating things about starting to use a new platform is that there will be an intimidatingly steep learning curve to perform the most basic things.</p><p>Kangas avoids this entirely by using syntax that is familiar to pythonistas and data scientists accustomed to the most common tools such as Pandas.</p><p>This allows immediate skill transfer without a struggle because the workflow will be the same from the beginning. The example below, for instance, highlights this.</p><pre>import kangas as kg<br><br>#reads csv and displays first 5 rows<br>dg = kg.read_csv(&quot;Iris.csv&quot;)<br>dg.head()</pre><p>The snippet above is for Kangas code.</p><pre>import pangas as pd<br><br>#reads csv and displays first 5 rows<br>df = pd.read_csv(&quot;Iris.csv&quot;)<br>df.head()</pre><p>The snippet above is for Pandas code.</p><p>The examples above may serve a small role in making you forget Kangas’s purpose, which is understandable. It must be clear that Kangas does not attempt to be Pandas but allows users to integrate their Pandas workflow into Kangas.</p><p>It is mentioned on Kangas’s Github page that “when you’ve wrangled your data into a Pandas Dataframe.” You can do all the heavy lifting and complex data cleaning and ingest that data through Kangas to visualize it as you please.</p><p>But despite Kangas not being a data cleaning tool, I have found one remarkable way of minimal data cleaning using Kangas that I found valuable.</p><h4>Minimal Data Cleaning</h4><p>Using Kangas’s “show()” method brings a visual interface to your Jupyter Notebook as you develop models or perform data cleaning.</p><p>As I have highlighted above, there’s no need to attempt data cleaning with Kangas, but there’s built-in functionality for one particular type of data cleaning: Dropping columns.</p><p>We often stumble upon data that we may find either challenging to use or completely unusable. Such data may be of poor quality and may reduce the quality of the model that will be trained. Dropping columns entirely during our visual workflow is a strong boon during experimentation to get a model up and running as quickly as possible.</p><p>The image below is a result of pressing the “Column” button above the table that appears when we run “dg.show()”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*eK2PE7REONxF69WuK5nggQ.png" /><figcaption>Image of columns by author</figcaption></figure><p>According to my analysis, the column we want to drop is the “society” column, as it is unusable. By pressing the small x button beside it, we drop it and get the result below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*eQudkeXe3vCt8wGQhOPEsw.png" /><figcaption>Image of columns without “society” by author</figcaption></figure><p>We finally download our new datagrid and proceed with our workflow. The download is on the far left of the bottom of the interface provided by Kangas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*5FosWmEBUkGhAup4eK4Q4A.png" /><figcaption>Screenshot by author</figcaption></figure><p>The above feature might be useful for a few. Now I can focus on another feature that I find exceedingly helpful: Default Type Focus.</p><h4>Default Type Focus</h4><p>I named it this way for lack of a better way to put it. Simply put, it highlights the features of a column by default when asked to display a section of the data.</p><p>This might seem like little, but it has two major benefits. The first benefit is that you’re not writing extra lines of code looking for this information. The second benefit is that you can easily know what to convert this data to during data preprocessing.</p><p>This feature is even more impressive when you consider that it even indicates columns that should be of a different data type. The image below is a good example of what I am talking about.</p><pre>dg = kg.read_csv(&quot;/home/mwaniki-new/Documents/Bengaluru-House-Prediction-main/Input/Train.csv&quot;)<br>dg.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*kGrnIHMlunA-Y6KI2Y_lRg.png" /><figcaption>Screenshot by author</figcaption></figure><p>It indicates how the column “total_sqft” is the wrong type and highlights its range to drive the point home.</p><p>This is a valuable tool in some instances, and knowing where conversions may be needed from the onset will save much development time and probably evade dealing with many kinds of errors.</p><h4>It Could Be Better…</h4><p>Kangas has integrated support for both Tensorboard and Pandas. I tried to test functionality for Polars, and as predicted, many problems were not readily solvable.</p><p>Another issue that users may find problematic is that the rendered datagrid interface with the “.show()” may not be dynamic. Custom themes and themes that do not have a white background, such as the default for Juypyter Notebooks, may not render the datagrid perfectly.</p><p>This now allows me to introduce you to one of Kangas’s greatest benefits: open-source development. On <a href="https://github.com/comet-ml/kangas">Kangas</a>’s Github page, they state that they are “more than happy to accept community contributions.”</p><p>Go ahead and build using Kangas or build Kangas itself.</p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d34e26fe6012" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/a-balanced-overview-of-kangas-features-d34e26fe6012">A Balanced Overview of Kangas Features</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Non-Deep Learning Approach to Computer Vision]]></title>
            <link>https://heartbeat.comet.ml/a-non-deep-learning-approach-to-computer-vision-90b8fa851da7?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/90b8fa851da7</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 11:10:03 GMT</pubDate>
            <atom:updated>2023-08-01T11:10:03.613Z</atom:updated>
            <content:encoded><![CDATA[<h4>A World of Computer Vision Outside of Deep Learning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aDJHv8FlRH7MIYnC" /><figcaption>Photo by <a href="https://unsplash.com/@museumsvictoria?utm_source=medium&amp;utm_medium=referral">Museums Victoria</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>IBM defines computer vision as “a field of artificial intelligence (AI) that enables computers and systems to derive meaningful information from digital images, videos and other visual inputs [1].”</p><p>Computer vision (CV) applications are often limited to deep learning methods. It may shock many people that deep learning is one of many approaches to CV, despite how ubiquitous it is in modern applications.</p><p>I stumbled upon a simple question, what was there before neural nets could efficiently be run on the average computer? Surely research in this field yielded results that could be used without requiring neural networks. If your curiosity brought you here, stick around to see what CV looks like without deep learning.</p><h4>Scale-Invariant Feature Transform (SIFT)</h4><p>This is an algorithm created by David Lowe in 1999. It is a potent force for many applications and has widespread use in fields such as robotics and object detection.</p><p>It’s a general algorithm that is known as a feature descriptor. It learns the features of different images similarly and does not have the limitation of working like a deep neural net, i.e., learning features specifically from the training set.</p><p>It has a relatively straightforward method of operation. After picking the set of images you desire to use, the algorithm will detect the keypoints of the images and store them in a database. Object detection will then occur via feature comparison between any new image’s features and the database’s features.</p><p>This is an oversimplification, as many steps occur between keypoint storage and feature comparison to detect things in images. <br>Another valuable feature descriptor algorithm is the Speeded Up Robust Features algorithm.</p><h4>Speeded Up Robust Features (SURF)</h4><p>This algorithm performs many of the same functions as the Scale-Invariant Feature Transform Algorithm. Its applications include 3D reconstruction and object recognition.</p><p>Discussing this algorithm without mentioning the previous one is difficult, as SIFT inspired SURF. Many of the significant steps taken to perform tasks are similar to those in the SIFT algorithm, albeit with some changes.</p><p>One example of this can be noted in the first step of the SURF algorithm. Instead of using cascaded filters to get the keypoints, it uses square-shaped filters. The incremental changes in all the steps lead to a boost in performance and even give the SURF algorithm a significantly higher performance than the SIFT algorithm.</p><h4>Features from Accelerated Segment Test (FAST)</h4><p>This is a corner detector algorithm and it does exactly that. It detects corners. Corners are an important feature to detect as it is possible to pinpoint and track the position of solid objects or regions.</p><p>It includes only two essential steps, unlike the previous methods that we highlighted. The first step looks at a particular point and uses a pixel circle. If it satisfies the given conditions of the algorithm, it will be classified as a corner. A “high-speed test” is performed to reject points that do not emerge as corners.</p><p>Despite the above simplification, we can rationalize that the importance of this algorithm is that we can tell a point that is a corner apart from one that isn’t in a given problem.</p><p>It is also valuable to note that it is faster than the solutions used in the SURF and SIFT algorithms, such as difference of Gaussians (DoF).</p><h4>Advantages</h4><p>One of the primary advantages of falling back on traditional computer vision methods is that you can save time and resources on a given task. In some scenarios, it is possible to completely avoid using deep learning methods such as deep neural networks and settle for a simpler algorithm.</p><p>Another advantage is that these algorithms are not limited to working independently. It is possible to improve the performance of these algorithms with machine learning algorithms such as Support Vector Machines. This is a good way of improving their performance and still not expending computing resources using deep learning.</p><p>One critical factor when using a model is whether it can easily be interpreted and tweaked accordingly. Traditional CV methods rely on parameters that can easily be adjusted whenever there is an issue. On the other hand, deep learning methods become more complicated when you consider the possible existence of millions of parameters for a given problem.</p><p>An additional advantage these traditional computer vision methods offer is easy deployability on microcontrollers and such devices on the edge. Increased access to computers has dramatically led to a decrease in the price of powerful machines. This doesn’t mean we should encourage computing expedience; it means that we now have a lot of variety in the tools we use and should be considerate about using them appropriately.</p><p>Finally, and probably most importantly, these traditional computer vision algorithms could be used to improve the performance of deep learning algorithms. Features extracted from them could be fed into neural networks for enhanced performance.</p><p>There is a strong case for using traditional computer vision algorithms over deep learning algorithms. In industries, academia, and even personal projects, there is always an opportunity to use a simpler solution that uses fewer resources and is fairly more efficient.</p><p>Deep learning is powerful and has made many strides in the right direction through painstaking development, but it is not a solution that will fit everywhere. The most appropriate way forward for a given problem is the most relevant onet, not the most ubiquitous.</p><h4>Sources</h4><p>[1] IBM. “What is Computer Vision?” IBM — United States. Accessed April 23, 2023. <a href="https://www.ibm.com/topics/computer-vision.">https://www.ibm.com/topics/computer-vision.</a></p><p>[2]O’Mahony, Niall, Sean Campbell, Anderson Carvalho, Suman Harapanahalli, Gustavo Velasco Hernandez, Lenka Krpalkova, Daniel Riordan, and Joseph Walsh. “Deep learning vs. traditional computer vision.” In <em>Advances in Computer Vision: Proceedings of the 2019 Computer Vision Conference (CVC), Volume 1 1</em>, pp. 128–144. Springer International Publishing, 2020.</p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90b8fa851da7" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/a-non-deep-learning-approach-to-computer-vision-90b8fa851da7">A Non-Deep Learning Approach to Computer Vision</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Memory Constraints in Image Classification]]></title>
            <link>https://heartbeat.comet.ml/understanding-memory-constraints-in-image-classification-637e5136dee2?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/637e5136dee2</guid>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[heartbeat]]></category>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Mon, 10 Jul 2023 13:11:50 GMT</pubDate>
            <atom:updated>2023-07-10T13:11:50.150Z</atom:updated>
            <content:encoded><![CDATA[<h4>And how to overcome them</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pM0uEv1MB_8EAS8G" /><figcaption>Photo by <a href="https://unsplash.com/@thefredyjacob?utm_source=medium&amp;utm_medium=referral">Fredy Jacob</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Image classification usually involves training algorithms to identify given objects in an image. It sounds like a reasonably straightforward matter but one is bound to fall into the many traps it holds for newcomers.</p><p>One such elaborate trap is dealing with memory constraints. When developing a model, it is necessary to have good training data in order for it to work optimally. It is easy to think that once you have the data then everything should align perfectly but then as you slowly progress, it becomes evident that you may have underestimated the severity of the task. Once you get to the part where you are supposed to train your model you receive a warning that “There is not enough memory for the task.” What do you do?</p><p>The above scenario arises if you’re working with numerous images, have inadequate memory and you’re manually converting your images to Numpy arrays in order to feed them into the model.</p><h4>How Numpy Array Conversion Works</h4><p>When working with images, one of the first operations that you perform is the conversion of image data to arrays. Normally the step looks like this:</p><p>Image — — — — &gt; Array — — — — &gt; Numpy Array</p><p>You convert the image to an array, normally using a library such as OpenCV and then you specify the X-variable(features) and the Y-variable(labels). After making this specification, you will convert the data into Numpy arrays using the Numpy library.</p><p>The Numpy Array is an efficient data structure that allows versatility when performing mathematical calculations. Unfortunately, efficiency does not mean perfection in all situations. Converting many images into a large Numpy array could lead to multiple Gigabytes of information being formed.</p><p>If you are short of memory, then performing tasks such as normalization of the Numpy array will lead to the entirety of your memory being occupied by it. The operation will occur in the memory and if the size of the Numpy array exceeds the size of the memory then your computer will halt all operations.</p><p>There are a few workarounds to being memory constrained, despite the valid concerns mentioned above. Intelligent minds have thought through the situation and have cleverly crafted ways to avoid this problem.</p><h4>“Just Eat Cake…”</h4><p>You don’t have enough memory? Why don’t you just buy more?</p><p>The most straightforward solution is to just get more memory. Unfortunately, if this were the easier option for everybody then I wouldn’t be writing this article.</p><p>It is possible that we will always run into memory shortages depending on how our work scales. So buying a few more Gigabytes of memory might be useless if you end up working with exponentially more data than it could manage. This is why learning how to manage your memory is a key lesson when dealing with image classification.</p><p>One of the greatest assurances we have when working with such memory constraints is that the major libraries that we have in use have this thought out and sorted. Below, we will look at NumPy and other solutions to this problem.</p><blockquote>Team wide collaboration is a core of good MLOps strategy. <a href="https://go.comet.ml/ebook-Building-Effective-ML-Teams.html?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_MQL_heartbeat_CTA">Learn what else makes effective ML teams work with our free ebook</a>.</blockquote><h4>Numpy memmap()</h4><p>After creating a Numpy array, you can store its binary as a Numpy file. Once you do this, there is no need to keep on repeating the process of converting images to Numpy arrays as you will already have all the information stored in your local drive as desired.</p><p>Once the Numpy binary is in the storage, you do not have to load all the information into memory when trying to train a model. This is where Numpy’s “memmap()” comes in.</p><p>According to Numpy’s documentation, its job is to “create a memory-map to an array stored in a <em>binary</em> file on disk.” It allows you to efficiently access small sections of a binary. This reduces the amount of memory you need to be using at a time. The system allows an individual to perform quick batch creation without having to load everything into memory.</p><p>Another additional benefit that arises when using memmap() is that it allows you to perform many of the same operations that you can perform on Numpy arrays.</p><p>Ignacio Oguiza’s <a href="https://colab.research.google.com/github/timeseriesAI/tsai/blob/master/tutorial_nbs/00_How_to_efficiently_work_with_very_large_numpy_arrays.ipynb#scrollTo=3vT4B_DL_YmC">noteboo</a>k on the topic gives a deeper dive into the topic as he gives multiple examples of how to effectively use Numpy’s memmap(). Now we can move to the next task of trying to avoid memory problems.</p><h4>Data Generators and DataLoaders</h4><p>Dataloaders and Data Generators are provided by Pytorch and Keras APIs respectively. A programmer can tactfully use them to ensure that they code all their functionality such as transformations in them without overwhelming the computer’s memory.</p><p>Two important functionalities that they have include balancing the number of labels in datasets and allowing small batches of data to be fed into the model at a time. It is easy to set the batch size at a time according to your requirements and according to your memory capacity.</p><p>The preference for using either boils down to the needs of the programmer. Pytorch may feel more natural to those who are used to using Numpy while Keras may feel easier to those who have been using it over time.</p><h3>Conclusion</h3><p>Now we have a good understanding of where our memory goes when we are doing our memory-intensive image processing applications. We know that it doesn&#39;t have to be that intensive as there are tools built to cater for those that do not have adequate memory.</p><p>Understanding the use of memmaps, dataloaders and data generators is necessary for memory-constrained applications. There are many advantages and a few disadvantages to all these. The underlying importance that you need to consider is the fact that you may not have enough memory for a task.</p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=637e5136dee2" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/understanding-memory-constraints-in-image-classification-637e5136dee2">Understanding Memory Constraints in Image Classification</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An End-to-End Guide to Using Comet ML’s Model Versioning Feature: Part 2]]></title>
            <link>https://heartbeat.comet.ml/an-end-to-end-guide-to-using-comet-mls-model-versioning-feature-part-2-64b66a857962?source=rss-a7870ab3194e------2</link>
            <guid isPermaLink="false">https://medium.com/p/64b66a857962</guid>
            <category><![CDATA[cometml]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[experiment-tracking]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[heartbeat]]></category>
            <dc:creator><![CDATA[Mwanikii]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 17:21:18 GMT</pubDate>
            <atom:updated>2023-03-27T17:21:18.964Z</atom:updated>
            <content:encoded><![CDATA[<h4>Model versioning and tracking with Comet ML</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RzaaZaQz9f-CJAHd" /><figcaption>Photo by <a href="https://unsplash.com/@nampoh?utm_source=medium&amp;utm_medium=referral">Maxim Hopman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In <a href="https://heartbeat.comet.ml/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1-258afc317f09"><strong>the first part of this article</strong></a>, we made a point to go through the steps that are necessary for you to log a model into the registry. This was necessary as the registry is where a machine learning practitioner can keep track of experiments and model versions.</p><p>The next step that I will address in this article involves the development of different models. Additionally, they will have a better performance than the one that had initially been logged. It is necessary as one can easily trace where performance increases and performance drops occur.</p><h4>Workflow</h4><p>The workflow will primarily be derived from what we did in the previous article. If we have a better-performing model than the previous one, we can keep it to improve the performance on test datasets. There will be no additional libraries and requirements. To review part one of this series, or to set up your environment for this workflow, check out my article below:</p><p><a href="https://heartbeat.comet.ml/an-end-to-end-guide-on-using-comet-mls-model-versioning-feature-part-1-258afc317f09">An End-to-End Guide on Using Comet ML’s Model Versioning Feature: Part 1</a></p><p>Steps that we will follow:</p><ol><li>Evaluating the performance of different models.</li><li>Setting up an experiment in our project and using its path to come up with a newer version of our model in the model registry of the initial model.</li><li>Naming our new model and seeing how we can interact with it.</li></ol><h4>Comparing model performance</h4><p>Different models offer varying levels of performance on a given dataset because of their inherent strengths and weaknesses. Sometimes this is a good thing as it may be beneficial to the outcome that a data scientist or machine learning practitioner may desire.</p><p>Let’s get to the code:</p><pre>import numpy as np<br>from sklearn.model_selection import cross_val_score<br>from sklearn.neighbors import KNeighborsClassifier<br>from sklearn.tree import DecisionTreeClassifier<br>from xgboost import XGBClassifier<br>from sklearn.neural_network import MLPClassifier<br>from sklearn.model_selection import StratifiedKFold<br>from sklearn.linear_model import LogisticRegression<br>from sklearn.ensemble import RandomForestClassifier<br><br>#Passing all the algorithms in a dict<br>models = { &#39;knc&#39; : KNeighborsClassifier(),<br>           &#39;dtc&#39; : DecisionTreeClassifier(),<br>           &#39;xgc&#39; : XGBClassifier(),<br>           &#39;mlp&#39; : MLPClassifier(max_iter=1000, random_state = 0),<br>           &#39;lr&#39;  : LogisticRegression(max_iter=500),<br>           &#39;rf&#39;  : RandomForestClassifier()<br>         }<br>#Function to calculate the cross validation score<br>def cross_val_eval(model, X, y):<br>    cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=5)<br>    cv_scores = cross_val_score(model, X, y, cv = cv, scoring=&#39;accuracy&#39;, n_jobs=-1, error_score=&#39;raise&#39;)<br>    return cv_scores<br><br>#passing the model_dict function into a variable<br>models = model_dict()<br><br>#Performance evaluation<br>results, names = list(), list()<br>for name, model in models.items():<br>    scores = cross_val_eval(model, X, y)<br>    results.append(scores)<br>    names.append(names)<br>    print(&#39;%s %.5f (%.3f)&#39; % (name, np.mean(scores), np.std(scores)))</pre><p>The above code evaluates the performance of different algorithms that are in the dictionary and the result is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*Qy-KqX7kam8jq4OPSGT4-A.png" /><figcaption>Screenshot by author</figcaption></figure><p>From the above image, the best-performing algorithms are MLPClassifier and Logistic Regression as they have the highest accuracy and the same standard deviation.</p><p>Picking either of them could allow for a better-performing model in comparison to the one that we had in the previous article. So I will pick the MLPClassifier algorithm for the next model.</p><blockquote>Have you tried Comet? <a href="https://www.comet.com/signup?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_SNUP_heartbeat_CTA">Sign up for free and easily track experiments, manage models in production, and visualize your model performance</a>.</blockquote><h4>2. Setting up an experiment and registering the model</h4><p>As we are performing model versioning then we need to make sure that all of our experiments are in the same Project and models in the same Registry.</p><p>From the first article, we have our Project named model-tracking where we ran an experiment with our first project that Comet automatically named intact_silo_3082.</p><p>Your project view should look as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3FuFzsvXO42Ii2isFH04ug.png" /><figcaption>Screenshot by author</figcaption></figure><p>When we click the “View Project button” (under “Uncategorized Experiments), then we will see our only (previous) experiment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdvtlXmuCqEpS5maOMkYIw.png" /><figcaption>Screenshot by author</figcaption></figure><p>Our objective is to add a new model to the registry so the first step would be to ensure we have it running as an experiment in the above project. So we will write our code as follows:</p><pre>#our new better performing algorithm<br>model1 = MLPClassifier(max_iter=1000, random_state = 0)<br><br>#fitting model<br>model1.fit(X, y)<br><br>#exporting model to desired location<br>dump(model1, &quot;model1.joblib&quot;)</pre><p>The next step would be to import Comet ML’s library to log the experiment under this project.</p><pre>from comet_ml import API, Experiment<br>experiment = Experiment()<br>api = API()<br><br>#naming the model &quot;model1&quot; and highlighting where it is stored in the computer<br>experiment.log_model(&quot;model1&quot;, &quot;/home/mwaniki-new/Documents/Stacking/model1.joblib&quot;)<br>experiment.end()</pre><p>Make sure to end your experiment with experiment.end() to prevent it from running perpetually and to finalizing all logging to the UI.</p><p>After we run the above code, we will have a new experiment logged and now we can use its path to register a new version of our model in the model registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oq1NI3ZLhhGnKm8bYToYQQ.png" /><figcaption>Screenshot by author</figcaption></figure><p>In the above screenshot, our new experiment is named intact_krill_7478 and when we click it, we’ll be able to copy the path from the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CvJrB6ysvaCjwhXUeq6pZA.png" /><figcaption>Screenshot by author</figcaption></figure><p>We will then use the above path to register the new version of our model after copying it.</p><h4>3. Adding the model to the registry</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYMmOfOsnworx9EnGAdGSQ.png" /><figcaption>Screenshot by author</figcaption></figure><p>Our model will already have version 1.0.0 that we made in the previous article. We will now add our newer version and name it 1.1.0 and view it from this page.</p><pre>experiment = api.get(&quot;mwanikinjagi/model-tracking/intact_krill_7478&quot;)<br>experiment.register_model(model_name=&quot;model1&quot;, version=&quot;1.1.0&quot;)<br>experiment.end()</pre><p>In the above code, we add our newer version model to the “model1” page that we have in the registry. The first action performed is pasting the path copied above into the “api.get()” method.</p><p>We then specify the model_name as “model_1” and name it “1.1.0”. The model registry page should then appear as it is below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*klyWz3Wzzxumkj_WOul1NQ.png" /><figcaption>Screenshot by author</figcaption></figure><p>We can now see that the model has two versions. The next step would be to click “View Model.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sg9yQsf9-ynYIIN3zFikIA.png" /><figcaption>Screenshot by author</figcaption></figure><p>The above screen appears. We can see our first and second models and their version names. On the far right, we have their source experiments that appear on the Project page.</p><p>Additionally, anyone with access to the workspace can download the models and begin utilizing them as it has already been uploaded to the registry.</p><h4>Wrap up</h4><p>This marks the end of the two-article series explaining how someone can track a model and its development using Comet ML. We have demonstrated that it is possible to develop a better model and keep track of its versions through the entire development process.</p><p><em>Editor’s Note: </em><a href="https://heartbeat.comet.ml/"><em>Heartbeat</em></a><em> is a contributor-driven online publication and community dedicated to providing premier educational resources for data science, machine learning, and deep learning practitioners. We’re committed to supporting and inspiring developers and engineers from all walks of life.</em></p><p><em>Editorially independent, Heartbeat is sponsored and published by </em><a href="http://comet.com/?utm_source=heartbeat&amp;utm_medium=referral&amp;utm_campaign=AMS_US_EN_AWA_heartbeat_EN"><em>Comet,</em></a><em> an MLOps platform that enables data scientists &amp; ML teams to track, compare, explain, &amp; optimize their experiments. We pay our contributors, and we don’t sell ads.</em></p><p><em>If you’d like to contribute, head on over to our</em><a href="https://heartbeat.comet.ml/call-for-contributors-fee7f5b80f3e"><em> call for contributors</em></a><em>. You can also sign up to receive our weekly newsletter (</em><a href="https://www.deeplearningweekly.com/"><em>Deep Learning Weekly</em></a><em>), check out the </em><a href="https://www.comet.com/site/blog/"><em>Comet blog</em></a><em>, join us on</em><a href="https://join.slack.com/t/fritz-ai-community/shared_invite/enQtNTY5NDM2MTQwMTgwLWU4ZDEwNTAxYWE2YjIxZDllMTcxMWE4MGFhNDk5Y2QwNTcxYzEyNWZmZWEwMzE4NTFkOWY2NTM0OGQwYjM5Y2U"><em> </em></a><a href="https://join.slack.com/t/cometml/shared_invite/zt-49v4zxxz-qHcTeyrMEzqZc5lQb9hgvw"><em>Slack</em></a><em>, and follow Comet on </em><a href="https://twitter.com/Cometml"><em>Twitter</em></a><em> and </em><a href="https://www.linkedin.com/company/comet-ml/"><em>LinkedIn</em></a><em> for resources, events, and much more that will help you build better ML models, faster.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64b66a857962" width="1" height="1" alt=""><hr><p><a href="https://heartbeat.comet.ml/an-end-to-end-guide-to-using-comet-mls-model-versioning-feature-part-2-64b66a857962">An End-to-End Guide to Using Comet ML’s Model Versioning Feature: Part 2</a> was originally published in <a href="https://heartbeat.comet.ml/">Heartbeat</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>