Skip to main content

Machine Learning Environment

Project description

VergeML

VergeML is a command line based environment for exploring, training and running state-of-the-art Machine Learning models. It provides ready-to-use models, handles data preprocessing and augmentation, tracks your AI's training sessions and provides other goodies such as an automatic REST interface.

Here is how it looks in action:

terminal

Installation

VergeML runs on Windows, Linux and MacOS. You need to have Python 3.6 and TensorFlow installed.

Get VergeML via pip:

pip install vergeml

Verify your installation by typing:

ml help

Congratulations, you have successfully installed VergeML! If you need further help, see the full installation guide.

Quick Start

Let's create a very simple image classifier which tells apart cats from dogs.

First, we create a new project for our classifier. Projects help you organize your data, save your training results and compare the performance between trained AIs.

Go to the directory where you want to create your project and type:

ml --model=imagenet new cats_dogs

This sets up a model based on Keras called imagenet, which is based on transfer learning.

Let's change to this project directory and have a look:

cd cats_dogs

VergeML will automatically create a samples folder and a configuration file (vergeml.yaml). Among other things, this configuration file defines the current model.

Let's get some help on what we can do with the current model:

ml help

In the output you will see a section on model functions. It says we have two model functions, train and predict. Let's try training first!

Start training!

To start training an AI we will need a dataset:

ml download:cats-and-dogs

Info: VergeML provides several datasets to get you started. To see a list type ml help download

After the download has finished, you will see a lot of images in your samples directory divided into two folders: cats and dogs.

Later, when you use your own data, simply copy your images into subdirectories of the samples directory. VergeML will automatically pick up the directory names as labels.

To start training, type:

ml train

As a first step, VergeML will feed each of our images into a pretrained neural network, extract their features as output and cache it on disk. (On a GPU, this will typically take around 15 minutes.) Then it will train a new neural network based on this output. As a last step it will combine these two networks into a single network tailored for our task of classifying cats and dogs. This process is called "transfer learning".

VergeML will print out the test accuracy after our training is finished to evaluate the model's final performance. Our cats-and-dogs classifier achieves 98.6%, which is pretty good.

Info: By default, VergeML reserves 10% of your samples as validation and 10% as testing data. This step is required to measure the accuracy of your model.

We can inspect our model's performance using the list command:

ml list

This will give you the name (prefixed by the @ sign) and several performance metrics.

For instance, the training accuracy (acc) will tell you how good your AI can classify the images it sees during training, while validation accuracy (val_acc) tells you how well it performs with unseen images.

Using the AI from the command line

Our cats-and-dogs classifier is now ready to use. Let's point it to an image of a cat or a dog and see what it predicts:

ml @name-of-your-AI predict <filename>

Info: You can even point it to a directory: ml @name-of-your-AI predict my_cats_and_dogs_pictures/*

Launching a REST service

Finally, let's deploy our newly trained AI on a web service:

ml @name-of-your-AI run:rest

VergeML provides an API explorer that will launch in a new browser window. (If you don't want the browser to open use the --no-browser option.)

For example, to use the REST interface with cURL:

curl -F 'files=@path/to/image' http://localhost:2204/predict

License

MIT

Copyright (c) 2018-2019 Markus Ecker

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vergeml-0.1.5.tar.gz (180.4 kB view details)

Uploaded Source

Built Distribution

vergeml-0.1.5-py3-none-any.whl (202.8 kB view details)

Uploaded Python 3

File details

Details for the file vergeml-0.1.5.tar.gz.

File metadata

  • Download URL: vergeml-0.1.5.tar.gz
  • Upload date:
  • Size: 180.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vergeml-0.1.5.tar.gz
Algorithm Hash digest
SHA256 53743866f4f76dbee4723b894965b234950f04451e9d0f27f20b4e529eb2f0e3
MD5 08889ce14b6db98bd99f5a57b14dbbdf
BLAKE2b-256 418b7c39e3ecd6d40e7ce4e518de712b7981b23e71dc2384724c12340468bf50

See more details on using hashes here.

File details

Details for the file vergeml-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: vergeml-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 202.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for vergeml-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b26052928bbed158358b94c2dcb87c11c8c08a98e36f782eeb732859013de2ae
MD5 b3176491d5a36f2e496ea988cb488631
BLAKE2b-256 dae0b38c926e91c92b37064ccee89f79630c35d3cf8b90df8acef9978d254b71

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page