Skip to main content

Reinforcement Learning and Deep Learning Library for Researcher and Engineer.

Project description

TENSORLAYER-LOGO

Awesome Documentation-EN Documentation-CN Book-CN Downloads

PyPI PyPI-Prerelease Commits-Since Python TensorFlow

Travis Docker RTD-EN RTD-CN PyUP Docker-Pulls Code-Quality

JOIN-SLACK-LOGO

TensorLayer is a novel TensorFlow-based deep learning and reinforcement learning library designed for researchers and engineers. It provides a large collection of customizable neural layers / functions that are key to build real-world AI applications. TensorLayer is awarded the 2017 Best Open Source Software by the ACM Multimedia Society.

Why another deep learning library: TensorLayer

As deep learning practitioners, we have been looking for a library that can address various development purposes. This library is easy to adopt by providing diverse examples, tutorials and pre-trained models. Also, it allow users to easily fine-tune TensorFlow; while being suitable for production deployment. TensorLayer aims to satisfy all these purposes. It has three key features:

  • Simplicity : TensorLayer lifts the low-level dataflow interface of TensorFlow to high-level layers / models. It is very easy to learn through the rich example codes contributed by a wide community.

  • Flexibility : TensorLayer APIs are transparent: it does not mask TensorFlow from users; but leaving massive hooks that help low-level tuning and deep customization.

  • Zero-cost Abstraction : TensorLayer can achieve the full power of TensorFlow. The following table shows the training speeds of classic models using TensorLayer and native TensorFlow on a Titan X Pascal GPU.

    CIFAR-10

    PTB LSTM

    Word2Vec

    TensorLayer

    2528 images/s

    18063 words/s

    58167 words/s

    TensorFlow

    2530 images/s

    18075 words/s

    58181 words/s

TensorLayer stands at a unique spot in the library landscape. Other wrapper libraries like Keras and TFLearn also provide high-level abstractions. They, however, often hide the underlying engine from users, which make them hard to customize and fine-tune. On the contrary, TensorLayer APIs are generally flexible and transparent. Users often find it easy to start with the examples and tutorials, and then dive into TensorFlow seamlessly. In addition, TensorLayer does not create library lock-in through native supports for importing components from Keras, TFSlim and TFLearn.

TensorLayer has a fast growing usage among top researchers and engineers, from universities like Imperial College London, UC Berkeley, Carnegie Mellon University, Stanford University, and University of Technology of Compiegne (UTC), and companies like Google, Microsoft, Alibaba, Tencent, Xiaomi, and Bloomberg.

Install

TensorLayer has pre-requisites including TensorFlow, numpy, and others. For GPU support, CUDA and cuDNN are required. The simplest way to install TensorLayer is to use the Python Package Index (PyPI):

# for last stable version
pip install --upgrade tensorlayer

# for latest release candidate
pip install --upgrade --pre tensorlayer

# if you want to install the additional dependencies, you can also run
pip install --upgrade tensorlayer[all]              # all additional dependencies
pip install --upgrade tensorlayer[extra]            # only the `extra` dependencies
pip install --upgrade tensorlayer[contrib_loggers]  # only the `contrib_loggers` dependencies

Alternatively, you can install the development version by directly pulling from github:

pip install git+https://github.com/tensorlayer/tensorlayer.git

Using Docker - a ready-to-use environment

The TensorLayer containers are built on top of the official TensorFlow containers:

Containers with CPU support

# for CPU version and Python 2
docker pull tensorlayer/tensorlayer:latest
docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest

# for CPU version and Python 3
docker pull tensorlayer/tensorlayer:latest-py3
docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-py3

Containers with GPU support

NVIDIA-Docker is required for these containers to work: Project Link

# for GPU version and Python 2
docker pull tensorlayer/tensorlayer:latest-gpu
nvidia-docker run -it --rm -p 8888:88888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-gpu

# for GPU version and Python 3
docker pull tensorlayer/tensorlayer:latest-gpu-py3
nvidia-docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-gpu-py3

Contribute

Please read the Contributor Guideline before submitting your PRs.

Cite

If you find this project useful, we would be grateful if you cite the TensorLayer paper:

@article{tensorlayer2017,
    author  = {Dong, Hao and Supratak, Akara and Mai, Luo and Liu, Fangde and Oehmichen, Axel and Yu, Simiao and Guo, Yike},
    journal = {ACM Multimedia},
    title   = {{TensorLayer: A Versatile Library for Efficient Deep Learning Development}},
    url     = {http://tensorlayer.org},
    year    = {2017}
}

License

TensorLayer is released under the Apache 2.0 license.

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 Distribution

tensorlayer-1.10.1.tar.gz (222.4 kB view details)

Uploaded Source

Built Distributions

tensorlayer-1.10.1-py3-none-any.whl (313.7 kB view details)

Uploaded Python 3

tensorlayer-1.10.1-py2.py3-none-any.whl (313.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tensorlayer-1.10.1.tar.gz.

File metadata

  • Download URL: tensorlayer-1.10.1.tar.gz
  • Upload date:
  • Size: 222.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for tensorlayer-1.10.1.tar.gz
Algorithm Hash digest
SHA256 decbabaf4bd3b4349acec04827ec82db24252b45d37915f4d6ec84a39328e4c7
MD5 3d7bcd99cf946e0ff05b6d06292f59b2
BLAKE2b-256 64a7f3d6ca0656169e2be3368e2b421d2a541d6e645abd5e505ac9a22ab85154

See more details on using hashes here.

Provenance

File details

Details for the file tensorlayer-1.10.1-py3-none-any.whl.

File metadata

  • Download URL: tensorlayer-1.10.1-py3-none-any.whl
  • Upload date:
  • Size: 313.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for tensorlayer-1.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef0b198f651f1c75c4fbead8907d83efaf44ad3c265276ec8b2a648eda570b65
MD5 e5f493eb5863e9f5ee4e840c1fcec6f8
BLAKE2b-256 ce646bf655988adc4a311a9d4956dcb090f605d4a38905419a615f04adda758c

See more details on using hashes here.

Provenance

File details

Details for the file tensorlayer-1.10.1-py2.py3-none-any.whl.

File metadata

  • Download URL: tensorlayer-1.10.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 313.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for tensorlayer-1.10.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c5db6a3de6957639fecd20df4f800bd13c79d53043f00796d2c1baf1c16196d5
MD5 08550b534225fa044b07434c91938ac1
BLAKE2b-256 c4e2736458723564163cfd87e3a9719a9fdece9011429bf556fb910d3691352e

See more details on using hashes here.

Provenance

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