Gear Up to Automate Your Machine/Deep Learning Model

Aman Miglani
4 min readMay 30, 2020

MACHINE LEARNING+ DEVOPS = MLOps.

Picture: www.jdriven.com

What is Machine /Deep Learning?

Machine Learning is the field of study that provides computer without being explicitly programmed and Deep Learning is the part of ML family that helps the computer to perform the human like tasks when we provide data to computer to it.

What is Devops?

DevOps is again made up of Development and Operations.This process helps the company to serve the client in a better and agile manner. DevOps made continuous integration and continuous delivery possible.It shortens product development cycle.

So Here I am to perform a practical to integrate Deep learning model with DevOps.

I have made up a model from mnist dataset and tuned up the hyper parameters automatically to get better accuracy and when my model was successfully created I delivered the report to admin that the “model is successfully created” and automation of this setup is done through Jenkins(a very famous open -source tool that works on JAVA ).

mnist dataset

So Lets start with the FIRST JOB

  1. JOB1 → In my first job all I have done is downloaded the code I have created in my local system and pushed it to github and then copied it to my jenkins server and build a trigger i.e Poll SCM so whenever there is any change in git repo I will get it on my server in no time.
downloading my program
trigger

So this mark the completion of Job1. Let’s begin Job2.

2. JOB2 → Firstly we need a dockerfile to build up the the image to launch our desired Operating System.

Dockerfile

Now chain the jobs so that it maintains the flow of our setup.

chaining

Now launch the OS using the shell provide in jenkins.

launching OS

3. JOB3 → In this job I trained my model to get the accuracy.I also provided the trigger so that my job6 can monitor my job3 and ask it to relaunch the container whenever one container face some failure and also chain the job2 with job3 .

triggers
training

4.JOB4 →Here I chained my Job3 with Job4 and copy my output to a file called output.txt saved in my jenkin’s workspace.My output contains the accuracy I get .As in my model I have applied a condition whenever i get the accuracy more than 90% that means my best model has been created.

chaining
directing output to a file
condition of the model to best
output

5.JOB5 →My Job5 is to send a confirmation mail to admin that your model is succcessfully created.In this I used a python code and import smtplib to send mail and automate it through jenkins.

python code for email
automating the mailing procedure
mail

6. JOB6 → So this job do monitor the process and if failure takes place in the present container it triggers to launch new one.

Monitoring
flow

And this marks the completion of my setup.This would not have been possible without the guidance and teachings of Mr. Vimal Daga and thank you all to read it.

--

--