Skip to main content

TinyMS is an Easy-to-Use deep learning development toolkit.

Project description

TinyMS

Pypi Python Build Status Documentation Status Releases LICENSE

English | 查看中文

TinyMS is an Easy-to-Use deep learning development toolkit based on MindSpore, designed to providing quick-start guidelines for machine learning beginners.

Installation

Please checkout the install document to quickly install or upgrade TinyMS project.

Quick start

Have no idea what to do with TinyMS❓ See the Quick Start to implement the image classification application in one minutes❗

Besides, here are some use cases listed to demonstrate how TinyMS simplifies the code flow for users.

Data loading and preprocess

from tinyms.data import MnistDataset, download_dataset
from tinyms.vision import mnist_transform

data_path = download_dataset('mnist')
mnist_ds = MnistDataset(data_path, shuffle=True)
mnist_ds = mnist_transform.apply_ds(mnist_ds)

Network construction

from tinyms.model import lenet5

net = lenet5(class_num=10)

Model train/evaluation

from tinyms.model import Model

model = Model(net)
model.compile(loss_fn=net_loss, optimizer=net_opt, metrics=net_metrics)
model.train(epoch_size, train_dataset)
model.save_checkpoint('./checkpoint_lenet.ckpt')
···
model.load_checkpoint('./checkpoint_lenet.ckpt')
model.eval(eval_dataset)

Model prediction

from PIL import Image
import tinyms as ts
from tinyms.model import Model, lenet5
from tinyms.vision import mnist_transform

img = Image.open(img_path)
img = mnist_transform(img)

net = lenet5(class_num=10)
model = Model(net)
model.load_checkpoint('./checkpoint_lenet.ckpt')

input = ts.expand_dims(ts.array(img), 0)
res = model.predict(input).asnumpy()
print("The label is:", mnist_transform.postprocess(res))

API documentation

If you are interested in learning TinyMS API, please find TinyMS Python API in API Documentation.

Community

For any developers who are not familiar with how TinyMS community works, please find the Contributing Guidelines to get started.

Release Notes

The release notes, see our RELEASE.

License

This work is licensed under Apache License 2.0.

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

tinyms-0.1.0.tar.gz (46.3 kB view hashes)

Uploaded Source

Built Distributions

tinyms-0.1.0-py3.7.egg (155.4 kB view hashes)

Uploaded Source

tinyms-0.1.0-py3-none-any.whl (79.5 kB view hashes)

Uploaded Python 3

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