Skip to main content

A library to help writing ai functions with ease.

Project description

Deeptech

A library that helps with writing ai functions fast.

It ships with a full Documentation of its API and Examples.

Getting Started

Please make sure you have pytorch installed properly as a first step.

pip install deeptech

Then follow one of the examples or check out the api documentation.

Design Principles

The api builds on three core parts: Data, Model or Training. Some parts which are considered core functionality that is shared among them is in the core package.

  • Data is concerned about loading and preprocessing the data for training, evaluation and deployment.
  • Model is concerned with implementing the model. Everything required for the forward pass of the model is here.
  • Training contains all required for training a model on data. This includes loss, metrics, optimizers and trainers.
  • Core contains functionality that is shared across model, data and training.

Tutorials & Examples

Starting with tutorials and examples is usually easiest.

Simple Fashion MNIST Examples:

Fashion MNIST

Here is the simplest mnist example, it is so short it can be part of the main readme.

from deeptech.data.datasets import FashionMNISTDataset
from deeptech.model.models import ImageClassifierSimple
from deeptech.training.trainers import SupervisedTrainer
from deeptech.training.losses import SparseCrossEntropyFromLogits
from deeptech.training.optimizers import smart_optimizer
from deeptech.core import Config, cli
from torch.optim import SGD


class FashionMNISTConfig(Config):
    def __init__(self, training_name, data_path, training_results_path):
        super().__init__(training_name, data_path, training_results_path)
        # Config of the data
        self.data_dataset = FashionMNISTDataset

        # Config of the model
        self.model_model = ImageClassifierSimple
        self.model_conv_layers = [32, 32, 32]
        self.model_dense_layers = [100]
        self.model_classes = 10

        # Config for training
        self.training_loss = SparseCrossEntropyLossFromLogits
        self.training_optimizer = smart_optimizer(SGD)
        self.training_trainer = SupervisedTrainer
        self.training_epochs = 10
        self.training_batch_size = 32


# Run with parameters parsed from commandline.
# python -m deeptech.examples.mnist_simple --mode=train --input=Datasets --output=Results
if __name__ == "__main__":
    cli.run(FashionMNISTConfig)

Contributing

Currently there are no guidelines on how to contribute, so the best thing you can do is open up an issue and get in contact that way. In the issue we can discuss how you can implement your new feature or how to fix that nasty bug.

To contribute, please fork the repositroy on github, then clone your fork. Make your changes and submit a merge request.

Origin of the Name

The name is a tribute to the deeptech:ai hackathon. When writing the library for fast, accessible ai development, I remembered how helpfull such a library could have been for a hackathon. Thus, I decided to name it as a tribute to that hackathon.

And besides, the name does not seem to be used for any company or library and sounds cool, at least to me. ;)

License

This repository is under MIT License. Please see the full license here.

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

deeptech-20210210.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

deeptech-20210210-py3-none-any.whl (72.4 kB view details)

Uploaded Python 3

File details

Details for the file deeptech-20210210.tar.gz.

File metadata

  • Download URL: deeptech-20210210.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for deeptech-20210210.tar.gz
Algorithm Hash digest
SHA256 6582918a3b40791b108bdfff60c35b41daab224a50f85ae92381289127d5d652
MD5 3668210528fa041507b7891ce0b134d6
BLAKE2b-256 38d9392699eb15683b67530fb370bf4ddd6654d5910ccce97c5144a9f8dd54f0

See more details on using hashes here.

File details

Details for the file deeptech-20210210-py3-none-any.whl.

File metadata

  • Download URL: deeptech-20210210-py3-none-any.whl
  • Upload date:
  • Size: 72.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for deeptech-20210210-py3-none-any.whl
Algorithm Hash digest
SHA256 70fcc563cdfac52d94f3bfb0d34f3614552fb7567fa50834e88e0e94507661c3
MD5 ed203aef0c6cf568bb9a5b6e73a34df9
BLAKE2b-256 07aa4ef52cf264f8c788f3d319d7a8b480c6bea3119c1d39948ca4e33fef2cf3

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