<?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 Arpit Kapoor on Medium]]></title>
        <description><![CDATA[Stories by Arpit Kapoor on Medium]]></description>
        <link>https://medium.com/@kapoor.arpit97?source=rss-fbafbdb4ded2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CRqnHR9xzNTH5SlXHTpFHQ.jpeg</url>
            <title>Stories by Arpit Kapoor on Medium</title>
            <link>https://medium.com/@kapoor.arpit97?source=rss-fbafbdb4ded2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:42:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kapoor.arpit97/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[Machine Learning lifecycle management using MLFlow]]></title>
            <link>https://medium.com/engineering-at-ooba/machine-learning-lifecycle-management-using-mlflow-64d3bd75b6bd?source=rss-fbafbdb4ded2------2</link>
            <guid isPermaLink="false">https://medium.com/p/64d3bd75b6bd</guid>
            <category><![CDATA[model-training]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ml-model-deployment]]></category>
            <category><![CDATA[mlflow]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Arpit Kapoor]]></dc:creator>
            <pubDate>Tue, 15 Sep 2020 09:00:18 GMT</pubDate>
            <atom:updated>2020-09-15T09:25:17.153Z</atom:updated>
            <content:encoded><![CDATA[<h3>Complete Machine Learning Lifecycle Management with MLFlow</h3><h4>Reproducibility; Experiment and metric tracking; Model versioning and Deployment.</h4><p>Managing machine learning model development can be a non-trivial task, involving multiple steps; model selection, framework selection, data processing, metric optimization, and lastly, model packaging and deployment. An organized workflow makes model management less complicated and adds reproducibility to experiments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*izjnFALO4ig-0jLsPf2yUw.jpeg" /></figure><h3>Introduction to MLflow</h3><p><a href="https://mlflow.org/"><strong>MLfLow</strong></a> is an open-source machine learning lifecycle management tool that facilitates organizing workflow for training, tracking and productionizing machine learning models. It is designed to work along with most recent machine learning libraries and frameworks available out there.</p><p>According to the official website, there are four components that MLflow currently offers:</p><ol><li><strong>Tracking:</strong> Record and query experiments: code, data, config, and results</li><li><strong>Projects: </strong>Package data science code in a format to reproduce runs on any platform</li><li><strong>Models: </strong>Deploy machine learning models in diverse serving environments</li><li><strong>Registry:</strong> Store, annotate, discover, and manage models in a central repository</li></ol><p>In the forthcoming sections, we will go over how all of these components can be leveraged to organize the machine learning workflow.</p><h3>Installing MLflow</h3><p>MLflow python package can be easily installed using pip or conda whichever you prefer.</p><pre>shell&gt; pip install mlflow</pre><p>If you are using Databricks, all the ML runtimes come with mlflow installed and can be readily used to log model runs on DBFS storage from a Databricks notebook.</p><p>To test the installation, run the mlflow command in the terminal:</p><pre>shell&gt; mlflow</pre><p>You should get an output similar to this:</p><pre>Usage: mlflow [OPTIONS] COMMAND [ARGS]...Options:<br>  --version  Show the version and exit.<br>  --help     Show this message and exit.Commands:<br>  azureml      Serve models on Azure ML.<br>  download     Downloads the artifact at the specified DBFS...<br>  experiments  Tracking APIs.<br>  pyfunc       Serve Python models locally.<br>  run          Run an MLflow project from the given URI.<br>  sagemaker    Serve models on SageMaker.<br>  sklearn      Serve SciKit-Learn models.<br>  ui           Run the MLflow tracking UI.</pre><h3>MLflow Tracking</h3><p>Tracking component consists of a UI and APIs for logging parameters, code version, metrics and output files. MLflow runs are grouped into experiments such that the logs for different runs of an experiment can be tracked and compared. This also provides the ability to visualize and compare the logged parameters and metrics. MLflow provides simple API Support for most popular platforms including Python, REST, R and Java.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*QDl_Z5lGpyi3p3YMBFCcQQ.jpeg" /><figcaption>MLflow Tracking Architecture</figcaption></figure><p>By default, mlflow uses local storage to run the tracking server. MLflow does provide the option to track runs to a remote server as well. This can be done by calling mlflow.set_tracking_uri() The remote tracking server can be assigned using a SQLALchemy link, local file path, HTTP server, or a Data Lake path.</p><p>The following snippet shows how to start a run and log parameters and metrics:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d78411fb0dddb34d90bc238e8ff1287/href">https://medium.com/media/9d78411fb0dddb34d90bc238e8ff1287/href</a></iframe><p>An artifact can be a file with model results or outputs. The log_artifact() method can be used to log such files generated by a run.</p><p>Mlflow stores all the runs under ‘<em>default’</em> experiment name, by default. We can assign an experiment name by using the set_experiment() method before calling the start_run()<em> </em>method which will create a run in this experiment.</p><pre>mlflow.set_experiment(‘MNIST’)</pre><p>MLflow also provides automatic experiment logging support for major machine learning frameworks; including Tensorflow, PyTorch, Gluon, XGBoost, LightGBM, SparkML, and FastAI. The autologging capability can be invoked by importing the <em>autolog </em>method from the supported framework binding provided in the mlflow package.</p><p>The following code snippet demonstrates how the autolog feature can be used with Tensorflow:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed1fdabb4bff8d279d57006d8f0b92fc/href">https://medium.com/media/ed1fdabb4bff8d279d57006d8f0b92fc/href</a></iframe><p>To access the mlflow UI, run the following command in the terminal from the same directory as the code:</p><pre>mlflow ui</pre><p>If you are using a remote tracking server, the same tracking URI must be provided as the backend store URI to start the mlflow UI. This can be done by passing an additional argument.</p><pre>mlflow ui --backend-store-uri &lt;path&gt;</pre><p>The MLflow UI can be accessed at: <a href="http://localhost:5000/"><em>http://localhost:5000</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jq5ayqfSJxQCb-b4rHY-Sg.png" /><figcaption>Experiment Tracking UI</figcaption></figure><p>What we have done so far? We created a script which autologs the necessary parameters and metrics for a tensorflow model training into an mlflow run. The mlflow UI shows a list of all the runs for a selected experiment with a brief description of the run in tabular format. The details of a run can be viewed by clicking on the timestamp.</p><p>MLflows autolog feature automatically logs all the necessary parameters (epochs, batch size, optimizer used, and learning rate etc.) and metrics (loss and criterion for train as well as validation data) during the run. It even logs the trained model which can be seen in artifacts section of the run in the UI.</p><p>It is important to observe and understand how the metrics change throughout a run. Visualizations are the best way to track the metric values through the training process. MLflow facilitates this by providing simple-to-use automated plot generation inside the mlflow run UI. By clicking on a metric we can visualize the plots for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1GyIygV2u8ZlMPqs2X3Krg.png" /><figcaption>Plot of training accuracy over time generated in mlflow UI</figcaption></figure><h3>MLflow Project</h3><blockquote>An MLflow Project is a format for packaging data science code in a reusable and reproducible way, based primarily on conventions.</blockquote><p>Essentially, an MLflow Project bundles various components of the machine learning code that includes the API and command-line tools for running projects. Each project is simply a directory of files, or a Git repository, containing your code. This makes it possible to chain together multiple projects into workflows.</p><p>Each project contains AnMLproject file which may look something like this:</p><pre>name: keras-mnist<br>conda_env: conda.yaml<br><br>entry_points:<br>  main:<br>    parameters:<br>      batch_size: {type: int, default: 100}<br>      epochs: {type: int, default: 1000}<br>    command: &quot;python train.py --batch_size={batch_size} --epochs={epochs}&quot;</pre><p>The MLproject file is used to define the name of the project, environment that is used to run the project, and what command to execute. The conda.yaml defines the environment dependencies for the project. This can be generated easily from an existing conda environment and looks something like this:</p><pre>name: keras-mnist<br>channels:<br>  - defaults<br>  - anaconda<br>  - conda-forge<br>dependencies:<br>  - python=3.6<br>  - pip<br>  - pip:<br>    - mlflow<br>    - tensorflow==2.3.0</pre><p>MLflow does support Docker environment and system environments as well. More information on this is available <a href="https://www.mlflow.org/docs/latest/projects.html#project-environments">here</a>.</p><p>The project can be executed by using the mlflow run command in the terminal from the same directory:</p><pre>shell&gt; mlflow run .</pre><p>This will build the conda environment and execute the command mentioned in the MLprojectfile. Inference scripts can similarly be packaged into a project.</p><h3>MLflow Models</h3><blockquote>An MLflow Model is a standard format for packaging machine learning models that can be used in a variety of downstream tools.</blockquote><p>Using the MLflow model format, models from various frameworks can be stored in a standard format which can be consumed in various forms including real-time serving through a REST API, batch inference on Apache Spark, or can even as a <a href="https://www.mlflow.org/docs/latest/python_api/mlflow.pyfunc.html"><em>python_function</em></a>.</p><p>Similar to MLflow Projects, MLflow Models contain two config files: MLmodel and conda.yaml which contain the model and environment configurations, respectively.</p><p>The MLmodel file looks contains the following:</p><pre>artifact_path: model<br>flavors:<br>  keras:<br>    data: data<br>    keras_module: keras<br>    keras_version: 2.4.3<br>  python_function:<br>    data: data<br>    env: conda.yaml<br>    loader_module: mlflow.keras<br>    python_version: 3.7.7<br>run_id: e256210d0ed94b4886efcfdf6f95aac3<br>utc_time_created: &#39;2020-09-15 07:08:50.850162&#39;</pre><p><em>data</em> is the directory containing the model files in native flavor format, which in this case is an <em>keras h5</em> model file.</p><p>The autologging feature also writes the model to the run directory. Path to the model can be used to serve this model as a REST API.</p><pre>mlflow models serve -m &lt;mlflow_model_uri&gt;</pre><h3>MLflow Model Registry</h3><blockquote>The MLflow Model Registry component is a centralized model store, set of APIs, and UI, to collaboratively manage the full lifecycle of an MLflow Model.</blockquote><p>An MLflow model can be registered to the centralized model registry which provides a convenient way to maintain model versions, annotate different version, and monitor their stages <em>(staging, production, and archived)</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Mr0tfW49l2_Frg1Z3g9LQ.png" /><figcaption>MLflow Model Registry UI</figcaption></figure><p>A <strong>Registered Model</strong> has a unique name, contains versions, associated transitional stages, model lineage, and other metadata. An MLflow model can either be registered using the UI workflow or using the python API:</p><pre><strong>from</strong> mlflow.tracking <strong>import</strong> MlflowClient</pre><pre># Create a Registered Model<br>client <strong>=</strong> MlflowClient()<br>client<strong>.</strong>create_registered_model(&quot;MNIST-Keras&quot;)</pre><pre># Create a model version<br>result <strong>=</strong> client<strong>.</strong>create_model_version(<br>    name<strong>=</strong>&quot;MNIST-Keras&quot;,           <br>    source<strong>=</strong>&quot;./mlruns/0/e256210d0ed94b4886efcfdf6f95aac3/\<br>    artifacts/model&quot;,<br>    run_id<strong>=</strong>&quot;e256210d0ed94b4886efcfdf6f95aac3&quot;<br>)</pre><p>The create_registered_model() method creates a new registered model in the model registry and the create_model_version() method creates a new version for the registered model. This method takes 3 parameters; name, source, and run id. Source is the path to the updated MLflow Model.</p><p>Another way to do this is using the register_model API:</p><pre>mlflow.register_model(<br>    &quot;runs:/e256210d0ed94b4886efcfdf6f95aac3/artifacts/model&quot;,<br>    &quot;MNIST-Keras&quot;<br>)</pre><p>If a model with the provided name does not exist this mlflow creates a new registered model with the name.</p><p>Model stage transition is another useful feature that mlflow provides. As the model evolves, its stage can be updated:</p><pre>client <strong>=</strong> MlflowClient()</pre><pre>client<strong>.</strong>transition_model_version_stage(<br>    name<strong>=</strong>&quot;MNIST-Keras&quot;,<br>    version<strong>=1</strong>,<br>    stage<strong>=</strong>&quot;Production&quot;<br>)</pre><p>The above command will update the stage of the <em>version 1</em> of the <em>‘MNIST-Keras’ </em>model to <em>Production</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNLIBYWC-oVyRn9v3KU8eQ.png" /><figcaption>Registered Model UI</figcaption></figure><p>A registered model can be served using the mlflow CLI:</p><pre>#!/usr/bin/env sh<br><br><em># Set environment variable for the tracking URL where the Model Registry resides</em><br>export MLFLOW_TRACKING_URI<strong>=</strong>http://localhost:5000<br><br><em># Serve the production model from the model registry</em><br>mlflow models serve -m &quot;models:/MNIST-Keras/Production&quot;</pre><p>The MLFLOW_TRACKING_URI environment variable should point to the tracking server <em>(mentioned in the mlflow tracking section)</em> where the model registry resides.</p><h3>Conclusion</h3><p>Thank you for reading this post! In this post, I have tried to cover all the major components of MLflow’s Machine Learning management toolkit. Aside from the areas covered in this post, MLflow also provides various deployment APIs for various infrastructures including, AWS Sagemaker, Microsoft Azure and Databricks clusters. In the future posts, we will show how to leverage the MLflow deployment APIs to deploy machine learning models to production in one of these Major infrastructure options.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64d3bd75b6bd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/engineering-at-ooba/machine-learning-lifecycle-management-using-mlflow-64d3bd75b6bd">Machine Learning lifecycle management using MLFlow</a> was originally published in <a href="https://medium.com/engineering-at-ooba">OoBA Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tensorflow model tracking with MLflow]]></title>
            <link>https://medium.com/analytics-vidhya/tensorflow-model-tracking-with-mlflow-e9de29c8e542?source=rss-fbafbdb4ded2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9de29c8e542</guid>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[mlflow]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Arpit Kapoor]]></dc:creator>
            <pubDate>Sun, 16 Aug 2020 11:37:00 GMT</pubDate>
            <atom:updated>2020-08-21T17:20:04.514Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7BkbEXKkfwPkI4kykRQhfQ.png" /></figure><p>Developing a machine learning model is an iterative process consisting of multiple steps such as — model selections, model training, hyperparameter tuning, and deploying model into production. Tracking the model through these stages in an organized way helps in tracking various issues like —small changes in data, code, or hyperparameters that affect the overall model performance. But model tracking can be a non-trivial task that may get messy at times. <a href="https://mlflow.org/"><strong>MLflow</strong></a> is an open source platform to manage the ML lifecycle, including experimentation, reproducibility, deployment, and a central model registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*j4axa8_lMRapIFr9LA87Rw.png" /></figure><p>Although tensorflow has it’s own model tracking tool — tensorboard, mlflow provides a simpler interface for tracking the experiments, while also making it easier to push the trained model into production.</p><p>Here, I will demonstrate how mlflow can be used to track tensorflow models using a remote tracking store. MLflow supports various <a href="https://www.mlflow.org/docs/latest/tracking.html#backend-stores">tracking backend store</a>. I will be using a MySQL database to store the experiments and model artifacts.</p><h3>Setting Up MySQL server</h3><p>First we need to set up a mysql server. I will be using a Docker container to start the server on my local machine. You can pull the <em>mysql-server</em> docker image by running the following command:</p><pre>shell&gt; docker pull mysql/mysql-server:latest</pre><p>Once the docker image is pulled, we can create a docker container from this image:</p><pre>shell&gt; docker run --name=mysqldb -p 3306:3306 -p 33060:33060 -d mysql/mysql-server:latest</pre><p>We map the ports 3306 and 33060 to the docker container so that we can access the database outside of the docker container. MySQL by default uses the port 3306 for access. We can see the details of the running container with <em>docker ps</em> command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUH3-1-p0hagkJz8tuRJiQ.png" /></figure><p>Now that our MySQL server is running, let’s do some access configurations for accessing the mysql server from outside the container. First, let’s configure the password for the <em>root</em> user. To do that we will need the automatically generated password for <em>root</em>.</p><pre>shell&gt; docker logs mysql1 2&gt;&amp;1 | grep GENERATED<br>GENERATED ROOT PASSWORD: Axegh3kAJyDLaRuBemecis&amp;EShOs</pre><p>We will now run mysql command from inside the docker to access the mysql command shell as <em>root</em>:</p><pre>shell&gt; docker exec -it mysql1 mysql -uroot -p</pre><p>Mysql will ask for the password, you must enter the password generated by mysql which we saw earlier. After this, we can change the password for the <em>root </em>user. Replace the string <strong>‘password’</strong> with the actual password that you want to set. To make the access available for the <em>root</em> user from outside the container, we will update the host value from <em>‘localhost’</em> to <em>‘%’.</em></p><pre>mysql&gt; alter user &#39;root&#39;@&#39;localhost&#39; identified by &#39;password&#39;;<br>mysql&gt; update mysql.user set host = ‘%’ where user=’root’;</pre><p>One last step, we will create a database called <em>mlflow </em>that mlflow will use to track the experiments and models.</p><pre>mysql&gt; create database mlflow</pre><p>That’s it, now we should be able to access the mysql server that we just set up from outside the docker container. You can test the connection using: <a href="https://www.mysql.com/products/workbench/"><strong>MySQL Workbench</strong></a><strong>. </strong>I am not going to go over that in this post but it is pretty straight forward.</p><h3>Writing Tensorflow training code</h3><p>If you don’t have tensorflow and mlflow installed, then both these packages can be installed using <em>pip install </em>command:</p><pre>shell&gt; pip3 install tensorflow<br>shell&gt; pip3 install tensorflow-datasets<br>shell&gt; pip3 install mlflow<br>shell&gt; pip3 install mysqlclient</pre><p>I will be demonstrating the model training using Tensorflow’s keras API by training a simple image classification model on MNIST dataset.</p><p>Let’s get to the code.</p><p>We will start by importing the required python modules:</p><pre>import tensorflow as tf<br>import tensorflow_datasets as tfds<br>import mlflow</pre><p>We use the <em>set_tracking_uri() </em>method to tell mlflow, where to store the training logs. The URI can be either a <em>‘/path/to/local/store’</em> or a SQLAlchemy databse URI:</p><pre>user = &#39;root&#39;<br>pwd = &#39;password&#39;<br>hostname = &#39;localhost&#39;<br>port = 3306<br>database = &#39;mlflow&#39;</pre><pre>uri = &#39;mysql://{user}:{password}@{hostname}:{port}/{databse}&#39;</pre><pre>mlflow.set_tracking_uri(uri)</pre><p>Mlflow stores all the runs under ‘<em>default’</em> experiment name, by default. We can assign an experiment name by using the <em>set_experiment() </em>method and <em>start_run() </em>method to create a run in this experiment.</p><pre>mlflow.set_experiment(‘MNIST’)<br>mlflow.start_run(run_name=”Run_1&quot;)</pre><p>Let’s load the data for training and validating the model:</p><pre>(ds_train, ds_test), ds_info = tfds.load(<br> ‘mnist’,<br> split=[‘train’, ‘test’],<br> shuffle_files=True,<br> as_supervised=True,<br> with_info=True,<br>)</pre><pre># Normalizes images: `uint8` -&gt; `float32`<br>def normalize_img(image, label):<br> return tf.cast(image, tf.float32) / 255., label</pre><pre># Train Dataset<br>ds_train = ds_train.map(<br> normalize_img, num_parallel_calls=tf.data.experimental.AUTOTUNE)<br>ds_train = ds_train.cache()<br>ds_train = ds_train.shuffle(ds_info.splits[‘train’].num_examples)<br>ds_train = ds_train.batch(128)<br>ds_train = ds_train.prefetch(tf.data.experimental.AUTOTUNE)</pre><pre># Test Dataset<br>ds_test = ds_test.map(<br> normalize_img, num_parallel_calls=tf.data.experimental.AUTOTUNE)<br>ds_test = ds_test.batch(128)<br>ds_test = ds_test.cache()<br>ds_test = ds_test.prefetch(tf.data.experimental.AUTOTUNE)</pre><p>Now, let’s define a neural network model using the keras API:</p><pre># Define the layers<br>inputs = tf.keras.Input(shape=(28, 28, 1))<br>hidden = tf.keras.layers.Flatten()(inputs)<br>hidden2 = tf.keras.layers.Dense(128, activation=’relu’)(hidden)<br>outputs = tf.keras.layers.Dense(10, activation=’softmax’)(hidden2)</pre><pre># Optimizer<br>opt = tf.keras.optimizers.Adam(learning_rate=0.002)</pre><pre># Create a Model object<br>model = tf.keras.Model(inputs, outputs)</pre><pre># Compile the model<br>model.compile(optimizer=opt, loss=’sparse_categorical_crossentropy’, metrics=[“accuracy”])</pre><p>MLflow comes with strong bindings for major deep learning frameworks, including, but not limited to Tensorflow, PyTorch, Gluon and XGBoost. These bindings provide <em>autolog </em>feature which logs the model training automatically to mlflow run. This makes it super convenient to log all the hyperparameters, metrics, and even the trained model while training.</p><pre>import mlflow.tensorflow<br>mlflow.tensorflow.autolog(<em>every_n_iter=2</em>)</pre><p><em>autolog</em> takes one parameter, <em>every_n_iter, </em>which is the number of training epochs between every log of the training metrics. For example, if the value passed is 2, mlflow will log the training metrics (loss, accuracy, and validation loss etc.) every 2 epochs.</p><p>Now, we can just can use the <em>model.fit()</em> method to train our deep learning model.</p><pre>model.fit(ds_train, epochs=100, validation_data=ds_test,<br>    batch_size=128)</pre><p>Once the model training is complete, we can end the run by calling:</p><pre>mlflow.end_run()</pre><p>And that’s it for the training code. We can now proceed to tracking the model and in metrics in the MLflow UI.</p><h3>Tracking in MLflow UI</h3><p>MLflow web UI can be started using the <em>mlflow ui</em> command. We will pass an additional parameter <em>— backend-store-uri</em>, which is nothing but the URI of the database from which we want mlflow to load the experiments. We use the same MySQL database URI as earlier:</p><pre>shell&gt; mlflow ui --backend-store-uri ‘mysql://root:password@localhost:3306/mlflow’</pre><p>The mlflow UI can be accessed at: <a href="http://localhost:5000/"><em>http://localhost:5000</em></a><em>.</em></p><p>In Experiments tab, you should be able to see our MNIST experiment. On clicking it, you can see all the runs for this experiment. MLflow gives a brief summary of each run on the experiment page. More detailed logs can be found on individual run page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GoThGZuyHRtl7jl1QWwdCg.png" /><figcaption>MLflow Experiment tracking UI</figcaption></figure><p>MLflow also provides an automated plot generation capability for different metrics with many available customizations. Here, we visualize the model training loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_KZZ--VdbluQOOiUwm2fZg.png" /><figcaption>Metric Plotting</figcaption></figure><p>Finally, mlflow also provides model registry. Although, this feature only works when we use remote tracking (like how we use MySQL) instead of local tracking. To register a model, all one needs to do is go to model artifacts on the run page and click on register model, after selecting the model you want to register.</p><p>Models registered under same name are automatically versioned.</p><h3>Conclusion</h3><p>In this post, I have tried to cover the basics of how tensorflow models can be tracked using mlflow. I believe mlflow is an excellent tool for end-to-end machine learning model lifecycle tracking. Model Registry and deployment capability makes mlflow a convenient bridge between model development and deployment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9de29c8e542" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/tensorflow-model-tracking-with-mlflow-e9de29c8e542">Tensorflow model tracking with MLflow</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>