• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

IBMDeveloperUK/Machine-Learning-with-Minishift: Managing ML dependencies is... a ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

IBMDeveloperUK/Machine-Learning-with-Minishift

开源软件地址(OpenSource Url):

https://github.com/IBMDeveloperUK/Machine-Learning-with-Minishift

开源编程语言(OpenSource Language):

HTML 83.6%

开源软件介绍(OpenSource Introduction):

Training and Deploying Machine Learning Models with Containers

Machine learning dependencies are a hassle...

Between ensuring that the right version Python/Pip are installed on your system, and that it doesn't conflict with other Python/Pip versions on your system AND that when you deploy your model to the cloud that the versions of the dependencies you've used in your projects are still compatible with the version on your cloud-based system, it's a wonder that we ever get any time to focus on building and training our neural networks.

Fortunately, there's a way to ensure that all of this is a never a problem again - Containers! (specifically, Minishift )

With containers, we can create a clean, virtual environment to setup and train our neural networks in and then deploy them at scale with the exact same same environment. No more dependency hell!

"But... won't that be slower?"

As with everything in life, there are caveats to this approach. You are training your network on a virtualised system, so you're not going to get the full, raw power of your machine being utilised in the training process. Even with small networks training can take quite some time; even longer inside a virtual environment. However, if you're a machine learning focussed developer with myriad networks to iterate and train, managing all of those dependencies can take hours to configure and there's no guarantee that, if there isn't a problem on your system, there won't be when it's deployed to the production environment.

Although this approach will take longer to train, the time savings in reducing the complexity of your setup should work to offset that, and when you complete this workshop, you'll be able to deploy your model to a super-scalable OpenShift Cluster (if you so wish) where you can scale to meet the needs of your users in next to no time at all.

"Can't I just use a Virtual Environment instead?"

Absolutely, if that works for you, go for it, but depending on the virtual environment you're using, it can be equally as awkward to prepare your project as managing the dependencies manually (in fact, I had the idea for this workshop after spending 6 hours fighting with my local environment). There's also guarantee that the environment you deploy your application to will have a matching configuration without some pre-emptive tweaking.

"OK... I'm interested..."

Cracking, then let's get started!

In this workshop you will learn...

  1. How to build a Convolutional Neural Network (CNN) that can detect handwritten digits (with Keras and the MNIST dataset)
  2. How to train and deploy a CNN with the Flask web framework and Keras
  3. How to install and run Minishift (a locally run OpenShift cluster of one image) on your machine
  4. How to create a project in OpenShift
  5. How to create an app in OpenShift and pull the source code for application from GitHub

By the end, you'll end up with a natty web app that will tell you what characters you're drawing, that'll look like this:

A video demonstrating the classification web app

Before We Start...

It's probably best that you install Minishift before we start diving into neural networking goodness. Mofe Salami has put together a fantastic workshop that walks you through the installation and basic setup of Minishift. If you pop on over there and follow just the setup steps of the workshop, then head back here, we'll be good to crack on.

You Will Need:

  1. A GitHub account
  2. A macOS/Windows/Linux system capable of running Minishift
  3. A modern web browser

Recognising Handwritten Digits with Keras + the MNIST Dataset

Training neural networks (NNs) to classify handwritten digits has become something of a "Hello, World" for developers looking to start tinkering with neural networks. The reasons for this are myriad, but three stand out:

  1. The dataset is small, so the network can be trained in a short space of time.
  2. For a very long time, computers struggled to recognise natural human input, but with NNs the problem is essentially trivial to solve (we'll likely get a > 98% accuracy with the model we'll build)
  3. The architecture for recognising handwritten digits is reusable for wider image classification cases, so if you're looking to analyse visual datasets with CNNs, MNIST is a great way to cut your teeth.

Starting Your Project

The code in this repo is a scaffold for the neural network and app that you'll end up with if you follow this workshop to the end.

So we can get the full benefit of Minishift's ability to pull code from a centralised repository and deploy it, you'll need to fork this repo to create your own version of it to work from.

You can do that with the following steps

  1. If you've not done so already, log in to your GitHub account (or create one here .
  2. Head back to this repository and then click the fork button at the very top of the UI. It looks like this:

An image highlighting to fork button

This will create a copy of this repository that you'll be able to make changes to, and deploy from.

  1. Once the forking process has completed, you need to clone it to your local system. You can do this by clicking the green "Clone or download" button just beneath the navigation for your repo, and then copying either the HTTPS or SSH link in the dialog that appears.

An image highlighting to fork button An image highlighting to fork button

  1. Once you've copied either link, head to your terminal and enter: git clone <URL YOU JUST COPIED>

  2. This will copy your forked version of the project to your local system. Now we're ready to start building a neural network!


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap