General deep learing utility library
Project description
DeepZensols Deep Learning Framework
This deep learning library was designed to provide consistent and reproducible results (see the full documentation).
Features:
- Easy to configure and framework to allow for programmatic debugging of neural networks.
- Reproducibility of results
- All random seed state is persisted in the trained model files.
- Persisting of keys and key order across train, validation and test sets.
- Analysis of results with complete metrics available.
- A vectorization framework that allows for pickling tensors.
- Additional layers:
- Full BiLSTM-CRF and stand-alone CRF implementation using easy to configure constituent layers.
- Convolutional layer factory with dimensionality calculation.
- Recurrent layers that abstracts RNN, GRU and LSTM.
- N deep linear layers.
- Conditional random field layer.
- Pandas interface to easily create and vectorize features.
- Multi-process for time consuming CPU feature vectorization requiring little to no coding.
- Resource and tensor deallocation with memory management.
- Real-time performance and loss metrics with plotting while training.
- Thorough unit test coverage.
- Debugging layers using easy to configure Python logging module and control points.
Much of the code provides convenience functionality to PyTorch. However, there is functionality that could be used for other deep learning APIs.
Documentation
See the full documentation.
Workflow
This package provides a workflow for processing features, training and then testing a model. A high level outline of this process follows:
- Container objects are used to represent and access data as features.
- Instances of data points wrap the container objects.
- Vectorize the features of each data point in to tensors.
- Store the vectorized tensor features to disk so they can be retrieved quickly and frequently.
- At train time, load the vectorized features in to memory and train.
- Test the model and store the results to disk.
To jump right in, see the examples section. However, it is better to peruse the in depth explanation with the Iris example code follows:
- The initial data processing, which includes data representation to batch creation.
- Creating and configuring the model.
- Using a facade to train, validate and test the model.
- Analysis of results, including training/validation loss graphs and performance metrics.
Examples
The Iris example (also see the Iris example configuration) is the most basic example of how to use this framework. This example is detailed in the workflow documentation in detail.
There are also examples in the form of Juypter notebooks as well, which include the:
- Iris notebook data set, which is a small data set of flower dimensions as a three label classification,
- MNIST notebook for the handwritten digit data set,
- debugging notebook.
Obtaining
The easist way to install the command line program is via the pip
installer:
pip3 install zensols.deeplearn
Binaries are also available on pypi.
Attribution
This project, or example code, uses:
- PyTorch as the underlying framework.
- Branched code from Torch CRF for the CRF class.
- pycuda for Python integration with CUDA.
- scipy for scientific utility.
- Pandas for prediction output.
- matplotlib for plotting loss curves.
Corpora used include:
Torch CRF
The CRF class was taken and modified from Kemal Kurniawan's pytorch_crf
GitHub repository. See the README.md
module documentation for more
information. This module was forked pytorch_crf with modifications.
However, the modifications were not merged and the project appears to be
inactive.
Important: This project will change to use it as a dependency pending
merging of the changes needed by this project. Until then, it will remain as a
separate class in this project, which is easier to maintain as the only
class/code is the CRF
class.
The pytorch_crf repository uses the same license as this repository, which the MIT License. For this reason, there are no software/package tainting issues.
See Also
The zensols deepnlp project is a deep learning utility library for natural language processing that aids in feature engineering and embedding layers that builds on this project.
Changelog
An extensive changelog is available here.
License
Copyright (c) 2020 Paul Landes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for zensols.deeplearn-0.1.1-py3.9.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 177e6e865df717b47a735509fe12292b5c4c0776896e94c38aca4bafe0dbf6eb |
|
MD5 | a8258d6b56284048a231ace3989d3014 |
|
BLAKE2b-256 | 5d9e022e7d4dc5c688a33b7c7688b7cf34f1130d1fe9863f3c7a02895af86cb3 |
Hashes for zensols.deeplearn-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61e72bc34b778b010c8267ece02aa3333ca4c1f7e4040d7f0db6653c5e615431 |
|
MD5 | e2471969454545d031f13c6ef9330b17 |
|
BLAKE2b-256 | 3500119aac7172d4237708abc612e7c227ca61c7c58fd12b1e89c8e97bebbb66 |