Skip to main content

The Dynamic Neural Network Toolkit

Project description


Build Status (Travis CI) Build Status (AppVeyor) Build Status (Docs) PyPI version

The Dynamic Neural Network Toolkit


DyNet is a neural network library developed by Carnegie Mellon University and many others. It is written in C++ (with bindings in Python) and is designed to be efficient when run on either CPU or GPU, and to work well with networks that have dynamic structures that change for every training instance. For example, these kinds of networks are particularly important in natural language processing tasks, and DyNet has been used to build state-of-the-art systems for syntactic parsing, machine translation, morphological inflection, and many other application areas.

Read the documentation to get started, and feel free to contact the dynet-users group group with any questions (if you want to receive email make sure to select "all email" when you sign up). We greatly appreciate any bug reports and contributions, which can be made by filing an issue or making a pull request through the github page.

You can also read more technical details in our technical report.

Getting started

You can find tutorials about using DyNet here (C++) and here (python), and here (EMNLP 2016 tutorial).

One aspect that sets DyNet apart from other tookits is the auto-batching feature. See the documentation about batching.

The example folder contains a variety of examples in C++ and python.


DyNet relies on a number of external programs/libraries including CMake and Eigen. CMake can be installed from standard repositories.

For example on Ubuntu Linux:

sudo apt-get install build-essential cmake

Or on macOS, first make sure the Apple Command Line Tools are installed, then get CMake, and Mercurial with either homebrew or macports:

xcode-select --install
brew install cmake  # Using homebrew.
sudo port install cmake # Using macports.

On Windows, see documentation.

To compile DyNet you also need a specific version of the Eigen library. If you use any of the released versions, you may get assertion failures or compile errors. You can get it easily using the following command:

mkdir eigen
cd eigen

C++ installation

You can install dynet for C++ with the following commands

# Clone the github repository
git clone
cd dynet
mkdir build
cd build
# Run CMake
# -DENABLE_BOOST=ON in combination with -DENABLE_CPP_EXAMPLES=ON also
# compiles the multiprocessing c++ examples
# Compile using 2 processes
make -j 2
# Test with an example

For more details refer to the documentation

Python installation

You can install DyNet for python by using the following command

pip install git+

For more details refer to the documentation


If you use DyNet for research, please cite this report as follows:

  title={DyNet: The Dynamic Neural Network Toolkit},
  author={Graham Neubig and Chris Dyer and Yoav Goldberg and Austin Matthews and Waleed Ammar and Antonios Anastasopoulos and Miguel Ballesteros and David Chiang and Daniel Clothiaux and Trevor Cohn and Kevin Duh and Manaal Faruqui and Cynthia Gan and Dan Garrette and Yangfeng Ji and Lingpeng Kong and Adhiguna Kuncoro and Gaurav Kumar and Chaitanya Malaviya and Paul Michel and Yusuke Oda and Matthew Richardson and Naomi Saphra and Swabha Swayamdipta and Pengcheng Yin},
  journal={arXiv preprint arXiv:1701.03980},


We welcome any contribution to DyNet! You can find the contributing guidelines here

Download files

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

Source Distribution

dyNET-2.1.2.tar.gz (509.4 kB view hashes)

Uploaded source

Built Distributions

dyNET-2.1.2-cp38-cp38-win_amd64.whl (5.1 MB view hashes)

Uploaded cp38

dyNET-2.1.2-cp38-cp38-manylinux1_i686.whl (3.6 MB view hashes)

Uploaded cp38

dyNET-2.1.2-cp37-cp37m-win_amd64.whl (5.1 MB view hashes)

Uploaded cp37

dyNET-2.1.2-cp37-cp37m-manylinux1_i686.whl (3.6 MB view hashes)

Uploaded cp37

dyNET-2.1.2-cp36-cp36m-win_amd64.whl (5.1 MB view hashes)

Uploaded cp36

dyNET-2.1.2-cp36-cp36m-manylinux1_i686.whl (3.6 MB view hashes)

Uploaded cp36

dyNET-2.1.2-cp35-cp35m-manylinux1_i686.whl (3.5 MB view hashes)

Uploaded cp35

dyNET-2.1.2-cp27-cp27m-manylinux1_i686.whl (3.4 MB view hashes)

Uploaded cp27

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page