Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify BiRNNBuilder to get easy access to the final hidden states of the component RNNs #263

Open
wants to merge 1,205 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1205 commits
Select commit Hold shift + click to select a range
9108ae5
clean up after myself
hayounav Oct 27, 2016
517b025
Merge pull request #128 from mattr1/mattri/winpython
neubig Oct 27, 2016
1fb14b5
reuse parameter-Expression for same parameters (python)
yoavg Oct 27, 2016
eda73c2
Merge branch 'master' of http://github.com/clab/dynet
yoavg Oct 27, 2016
f9a5f6c
added xor-mp example and fixed segrnn-sup example
Oct 28, 2016
a8d8edc
prolly a bad idea to just drop important flags
Oct 28, 2016
80791cf
allow xor-mp to dump its model to stdout
Oct 28, 2016
43a8d6e
Fixed extraneous assignment
neubig Oct 28, 2016
ddff18d
add the -O1/-O2 swith for the gcc4.9 or later versions.
Oct 28, 2016
2a44f15
Merge pull request #127 from pmichel31415/master
neubig Oct 28, 2016
7f986d9
Added RandomBernoulli and RandomUniform nodes
Oct 28, 2016
bffdc98
Changed windows build to just not include (unsupported) rnnlm-mp in m…
mattr1 Oct 29, 2016
c85f273
Latest version of Eigen no longer needs these windows-specific change…
mattr1 Oct 29, 2016
4fd23ac
Merge branch 'master' into mattri/winfix2
mattr1 Oct 29, 2016
bf78d62
Updating instructions to say that neither multi-process example will …
mattr1 Oct 29, 2016
3f39354
Merge pull request #134 from mattr1/mattri/winfix2
neubig Oct 29, 2016
69e3042
fix warning on strict compilers
redpony Oct 30, 2016
8904224
Merge pull request #133 from odashi/master
neubig Oct 31, 2016
e6ab58b
fix lingering python2 vs python3 compatibility issue
hayounav Nov 1, 2016
5b32849
I broke the dynet python package. This fixes it as well the problem w…
hayounav Nov 1, 2016
b8ead04
forgot these two files in the last commit
hayounav Nov 1, 2016
362ede0
make dynet_viz be python 3 compatible
hayounav Nov 1, 2016
7aea2bc
Merge remote-tracking branch 'upstream/master'
hayounav Nov 1, 2016
ada442a
fixed load and save to work in python 3 as well, considering the chan…
hayounav Nov 2, 2016
b833b19
Removed a compile warning
neubig Nov 4, 2016
79e1177
Merge branch 'master' of https://github.com/clab/dynet
neubig Nov 4, 2016
08e7057
added treelstm
Nov 5, 2016
213a01d
A few comments about expressions
neubig Nov 5, 2016
b3acb02
Did some documentation
neubig Nov 5, 2016
2bed829
Merge branch 'master' of https://github.com/clab/dynet
neubig Nov 5, 2016
e510992
Reordering of the expressions
neubig Nov 5, 2016
84ca6a2
Added documentation for some arithmetic
neubig Nov 5, 2016
60cceec
added missing .h file
Nov 6, 2016
b31c1e7
Merge branch 'master' of github.com:clab/dynet
Nov 6, 2016
15e8c66
small compile fix for older compilers
Nov 7, 2016
26bb0b3
avoid errors/warnings on different compilers
Nov 7, 2016
5bba10c
Adding installation notes for OS X
Nov 7, 2016
7e7f50a
Adding MacPorts installation instructions as well
Nov 7, 2016
d0282b4
Merge pull request #149 from jkkummerfeld/master
neubig Nov 7, 2016
dfa5b27
Change "assert(false)" to "throw exception(...)" so it always fails a…
mattr1 Nov 7, 2016
7c09434
Adding MKL_NUM_THREADS to MKL documentation.
mattr1 Nov 8, 2016
459a604
Merge pull request #151 from mattr1/mattri/f3_mkldoc
neubig Nov 8, 2016
82ad937
Merge pull request #150 from mattr1/mattri/f1_assert
neubig Nov 8, 2016
8298e69
Fixed constness of ParameterInit with add_parameters. Added a virtual…
Nov 9, 2016
df3eec5
Fixed an include path in dynet.pxd
Nov 9, 2016
fbfe34f
Add initializers to dynet_viz
danielhers Nov 6, 2016
c00b876
copy dict properties by need in Saveable instead of copying everythin…
hayounav Nov 10, 2016
d2060ec
more pyt3 bytes vs p2 bytes compatibility changes
hayounav Nov 10, 2016
f40e287
Merge remote-tracking branch 'upstream/master'
hayounav Nov 10, 2016
516319b
Added sparsemax to the Python bindings.
andre-martins Nov 12, 2016
af61156
Merge pull request #162 from andre-martins/master
neubig Nov 12, 2016
d5320ef
Merge pull request #144 from danielhers/initializers
neubig Nov 12, 2016
3fa9d52
Fix #161: support save/load BiRNNBuilder
danielhers Nov 13, 2016
e712c08
Merge remote-tracking branch 'upstream/master'
hayounav Nov 14, 2016
587059d
Merge pull request #163 from danielhers/birnn_save
yoavg Nov 17, 2016
d5faca4
Documentation and standardization for arithmetic
neubig Nov 18, 2016
a875733
Update python.rst
yoavg Nov 21, 2016
771bc9f
Merge remote-tracking branch 'upstream/master'
hayounav Nov 21, 2016
a12a066
Update install.rst
yoavg Nov 21, 2016
843ac1e
Update python.rst
yoavg Nov 21, 2016
168e9de
addad zeroes, random_normal, random_uniform, random_bernoulli to python.
yoavg Nov 21, 2016
97b12ca
Added threshold clipping to python bindings
pmichel31415 Nov 21, 2016
3068374
Merge branch 'master' of https://github.com/clab/dynet
yoavg Nov 21, 2016
2c1551a
Merge pull request #180 from pmichel31415/master
yoavg Nov 21, 2016
07a154c
Added support for gradient clipping disabling to python
pmichel31415 Nov 21, 2016
d219cdd
Some more documentation for pickneglogsoftmax etc.
neubig Nov 21, 2016
f3e9ea9
Merge pull request #181 from pmichel31415/master
yoavg Nov 21, 2016
248e202
Merge branch 'master' of https://github.com/clab/dynet
neubig Nov 21, 2016
a382788
Merge remote-tracking branch 'upstream/master'
hayounav Nov 21, 2016
d34ce16
Added a bunch of missing functions
pmichel31415 Nov 21, 2016
3caa003
Merge pull request #130 from hayounav/master
yoavg Nov 21, 2016
3e064f1
Merge remote-tracking branch 'upstream/master'
pmichel31415 Nov 21, 2016
aa03883
Fixed some linking problems?
neubig Nov 21, 2016
338c2a0
Merge branch 'master' of https://github.com/clab/dynet
neubig Nov 21, 2016
3b60eec
Made it possible to do dense updates
neubig Nov 21, 2016
cfa20d4
Added some tests for sum with minibatches
neubig Nov 22, 2016
a704e6b
Gradient clipping should be performed with respect to scale parameter
Nov 22, 2016
e56018d
Merge branch 'master' of https://github.com/clab/cnn
Nov 22, 2016
2bfd470
Merge pull request #183 from pmichel31415/master
neubig Nov 22, 2016
54c5e39
ability to get expression's dimension
yoavg Nov 22, 2016
596c762
Merge pull request #185 from clab/get_dim
neubig Nov 22, 2016
0ef4931
Re-inputting the generated output
talbaumel Nov 22, 2016
24859a0
Merge pull request #190 from talbaumel/patch-1
neubig Nov 22, 2016
5ce7e53
Fixed a bug in concatenate with batches
neubig Nov 22, 2016
b10db84
Merge branch 'master' of https://github.com/clab/dynet
neubig Nov 22, 2016
efe0711
Added unorthodox documentation and fixed l2 name
neubig Nov 25, 2016
f86ce37
Fixed some documentation
neubig Nov 25, 2016
fcfee6f
Explained about sparse Adam and Momentum are incorrect
neubig Nov 25, 2016
26a03d8
Fixed references
neubig Nov 25, 2016
82e901d
added ability to get the "head" of an rnnpointer
Nov 26, 2016
dc9df2c
Merge branch 'master' of https://github.com/clab/cnn
Nov 26, 2016
988dc78
Added hinge loss documentation
neubig Nov 26, 2016
12bc335
Merge branch 'master' of https://github.com/clab/dynet
neubig Nov 26, 2016
0d6e8e9
Add Travis CI badge to README
danielhers Nov 27, 2016
a389d5b
Merge pull request #194 from danielhers/master
neubig Nov 27, 2016
2817f3a
Fixed minor typos and inconsistencies in documentation
mitchellstern Nov 27, 2016
1ef5b8a
Fixed typo in string representation of `Expression` class
mitchellstern Nov 27, 2016
a5c4a29
Changed "errror" to "error"
mitchellstern Nov 27, 2016
2f6289e
Changed "with with" to "with"
mitchellstern Nov 27, 2016
63c7e33
Documentation for sparsemax
neubig Nov 28, 2016
aa62736
Update documentation following Python 3 support
danielhers Nov 28, 2016
bd0bd6a
Merge pull request #197 from danielhers/master
neubig Nov 28, 2016
2fb3abb
Merge pull request #195 from mitchellstern/master
neubig Nov 28, 2016
174c010
Added documentation of losses
neubig Nov 28, 2016
5ee2269
Merge branch 'master' of https://github.com/clab/dynet
neubig Nov 28, 2016
e66d515
exposes logsumexp
as1986 Nov 28, 2016
6f9abe2
Merge branch 'master' of github.com:as1986/dynet
as1986 Nov 28, 2016
8eca4ab
Merge pull request #199 from as1986/master
neubig Nov 28, 2016
5b1c4a7
typo
as1986 Nov 28, 2016
b109b3a
Merge pull request #200 from as1986/master
yoavg Nov 28, 2016
98582c4
Fixed slicing in Python interface
mitchellstern Nov 29, 2016
71fc893
Added support for scaling bernoulli variables
neubig Nov 30, 2016
1544e73
Merge remote-tracking branch 'upstream/master'
mitchellstern Nov 30, 2016
3e2763f
Simplified examples
pmichel31415 Dec 5, 2016
738f5e4
Reformatted examples
pmichel31415 Dec 5, 2016
6fbdef8
Mutualize python and C++ examples
pmichel31415 Dec 5, 2016
d943bcb
Add readme to examples
pmichel31415 Dec 5, 2016
322adaa
Remove garbage
pmichel31415 Dec 5, 2016
08d8f85
Add examples to doc
pmichel31415 Dec 5, 2016
70b72f9
bugfix
pmichel31415 Dec 5, 2016
45bf81f
Added support for negative indices and default slice arguments
mitchellstern Dec 6, 2016
e6a5878
Merge pull request #202 from mitchellstern/master
yoavg Dec 6, 2016
3c0d653
Merge remote-tracking branch 'upstream/master' into simpler_examples
pmichel31415 Dec 6, 2016
b23f603
typos
pmichel31415 Dec 6, 2016
d076a23
Refactor rnnlm-batch example + add doc
pmichel31415 Dec 6, 2016
e7738aa
Put rnnlm in examples to clean the root directory
pmichel31415 Dec 6, 2016
f06ea46
Remove rnnlm from cmakelist
pmichel31415 Dec 6, 2016
3d15de2
Merge pull request #204 from pmichel31415/simpler_examples
neubig Dec 7, 2016
b3565c9
typo for inverted dropout in doc
pmichel31415 Dec 7, 2016
4de0d93
Corrected a NASTY bug in expr.h with breathe
pmichel31415 Dec 7, 2016
3a3ffb2
Merge pull request #205 from pmichel31415/master
pmichel31415 Dec 7, 2016
ebdd50f
Add doc build status
pmichel31415 Dec 7, 2016
a897096
added python tutorial stub
nsaphra Dec 9, 2016
88f108a
Update tutorial.rst
nsaphra Dec 9, 2016
40058bb
Merge pull request #206 from nsaphra/patch-1
yoavg Dec 9, 2016
58659a4
Update API.ipynb
yoavg Dec 9, 2016
a60401e
Added some documentation of flow expressions
neubig Dec 10, 2016
da022e8
Added noising documentation
neubig Dec 10, 2016
28f3e9a
Removed some extraneous stuff in doc
neubig Dec 10, 2016
0f2e7fa
Fixed rescaling of lookup parameters
neubig Dec 10, 2016
907ec98
Fixed warning
neubig Dec 10, 2016
8c727ce
Removed unnecessary CPU mem alloc when using GPU
neubig Dec 10, 2016
2cc0a32
Changed pointers to references where `nullptr` is invalid
mitchellstern Dec 11, 2016
462440e
Fixed some "unused" and "reorder" warnings
mitchellstern Dec 11, 2016
dd952ba
Fixed some "unused" warnings
mitchellstern Dec 11, 2016
9e9f526
Updated documentation
mitchellstern Dec 11, 2016
8889f15
Fixed missing pass of edecay
neubig Dec 12, 2016
014b36f
Merge remote-tracking branch 'remotes/upstream/master'
mitchellstern Dec 12, 2016
8d6c346
Added unimplemented function
neubig Dec 12, 2016
97867c5
Merge pull request #207 from mitchellstern/master
neubig Dec 12, 2016
87bd7c0
Added coding style standards
neubig Dec 12, 2016
0042321
Added coding style
neubig Dec 12, 2016
3c32a97
Fixed bullets in doc
neubig Dec 12, 2016
53720f3
Added reference to inverted dropout
neubig Dec 12, 2016
336a44f
Added identity init
neubig Dec 12, 2016
3d0661c
Fixed stupid bug resulting from lack of coffee
neubig Dec 12, 2016
1ec1c82
Added initializer to LookupParameter in Python
neubig Dec 13, 2016
13a404d
Added ability to do dense updates in Python
neubig Dec 13, 2016
ee5992e
Create python_tutorial.rst
nsaphra Dec 13, 2016
9eecc4c
Merge pull request #210 from nsaphra/patch-2
yoavg Dec 13, 2016
8ef4dd3
Add ipython notebooks to the docs
pmichel31415 Dec 13, 2016
189df86
Add MNIST example
pmichel31415 Dec 13, 2016
94f6ac1
fixed save example
nsaphra Dec 14, 2016
fd70628
Merge pull request #214 from nsaphra/patch-4
yoavg Dec 14, 2016
3605089
Add ipython notebooks to the docs (#212)
pmichel31415 Dec 14, 2016
11439f9
Merge remote-tracking branch 'upstream/master' into mnist_example
pmichel31415 Dec 14, 2016
f237b28
Reorganise examples by programming language (#216)
pmichel31415 Dec 14, 2016
64aac82
Merge remote-tracking branch 'upstream/master' into mnist_example
pmichel31415 Dec 14, 2016
dd11d88
Correct examples path in doxyfile
pmichel31415 Dec 14, 2016
d7448d8
Move examples
pmichel31415 Dec 14, 2016
cfe250b
Merge remote-tracking branch 'upstream/master' into mnist_example
pmichel31415 Dec 14, 2016
3271186
Merge pull request #217 from pmichel31415/mnist_example
neubig Dec 14, 2016
bcea61e
Fix dead links causing failed doc build
pmichel31415 Dec 15, 2016
242a0f7
Fixed bug when using Adam w/ status updates
neubig Dec 17, 2016
3912b07
Merge branch 'master' of https://github.com/clab/dynet
neubig Dec 17, 2016
4476918
Added info on Anaconda
neubig Dec 19, 2016
3be0ec1
Added cython to anaconda doc
neubig Dec 21, 2016
c7829b3
Basic Python 3 support for Python examples
neubig Dec 21, 2016
64be077
Added ability to print text graphviz
neubig Dec 21, 2016
162cb9a
Speed improvements to CPU batched AffineTransform
neubig Dec 21, 2016
b9308e4
add select_rows, select_cols to python
yoavg Dec 21, 2016
70531f2
Fixed documentation for logistic function
mitchellstern Dec 22, 2016
18a3843
Merge pull request #221 from mitchellstern/master
neubig Dec 22, 2016
b0f2ea6
Fixed inconsistent initialization in Py and C++
neubig Dec 22, 2016
3e325e6
Merge branch 'master' of https://github.com/clab/dynet
neubig Dec 22, 2016
642e7ac
Simplify LogSoftmax (#218)
yv Dec 22, 2016
4fbf944
Python 3 bugfix: builder_layers must be a list, not a zip object (#222)
mitchellstern Dec 22, 2016
60cfd80
Match original TreeLSTM paper name
neubig Dec 22, 2016
f483994
Merge branch 'master' of https://github.com/clab/dynet
neubig Dec 22, 2016
c03aae6
Fixed const problem in expressions
neubig Dec 22, 2016
d33f111
Disable finite-math-only opimizations to avoid nan problems (clab/dyn…
yv Dec 23, 2016
d9e3fb2
Merge pull request #223 from yv/master
neubig Dec 24, 2016
5c48097
Changed dynet module alias from pc to dy
mitchellstern Dec 25, 2016
55b8648
Merge pull request #225 from mitchellstern/master
neubig Dec 27, 2016
9b3ae8d
Fixed off-by-one error in slice stop index bounds checking (#227)
mitchellstern Dec 27, 2016
6f8b647
Switch for logsumexp on GPU
neubig Dec 28, 2016
a2d050e
Better CUDA impl of SumBatches
neubig Dec 29, 2016
34f3d16
Efficiency improvement for SimpleRNN
neubig Dec 29, 2016
e9cee42
Optimization of PickNegLogSoftmax on GPU
neubig Dec 30, 2016
d8fe5f6
Regular malloc is faster
neubig Dec 30, 2016
0fa9671
More efficient sum
neubig Dec 30, 2016
ba2fd12
Faster lookup on GPU
neubig Dec 30, 2016
5209cd6
Fixed two bugs
neubig Dec 30, 2016
3b55869
Fix typo
bskaggs Dec 30, 2016
3a1aa10
Merge pull request #228 from bskaggs/patch-1
neubig Jan 2, 2017
00d95b0
Fixed bug in params
neubig Jan 2, 2017
7935e79
Selective pick of VanillaLSTMBuilder
neubig Jan 4, 2017
c4b4013
Document dimension object
pmichel31415 Jan 5, 2017
1013629
Merge remote-tracking branch 'upstream/master' and add missing doc
pmichel31415 Jan 5, 2017
ee18894
Add to doxygen + sphinx
pmichel31415 Jan 5, 2017
9ba8e43
Remove from minibatch.rst & change group name
pmichel31415 Jan 6, 2017
630c704
Merge pull request #232 from pmichel31415/dim_doc
neubig Jan 6, 2017
d7666c4
Added dynet link
neubig Jan 9, 2017
792219b
Added info about mailing list to main doc
neubig Jan 9, 2017
55d0c8f
fix windows compiling error by modifying the unsupported initializer_…
Oneplus Jan 10, 2017
9032b30
Merge pull request #235 from Oneplus/win_compile_fix
neubig Jan 10, 2017
2e2ef7b
inline doc for inputMatrix
yoavg Jan 13, 2017
11f456d
fixing cmake error with defined BOOST_ROOT
cherryc Jan 13, 2017
cb7b996
Update dynet_viz.py
yoavg Jan 13, 2017
135567f
Added some minibatching doc
neubig Jan 16, 2017
f40d0af
Merge branch 'master' of https://github.com/clab/dynet
neubig Jan 16, 2017
6a6db54
Fixes to minibatching doc
neubig Jan 16, 2017
51da65b
Added doc for multiprocessing
neubig Jan 16, 2017
9d35f04
Some fixes to doc
neubig Jan 16, 2017
b36cd27
Updating install docs to be consistent with build
Jan 16, 2017
06e43cd
Merge pull request #241 from cherryc/master
neubig Jan 16, 2017
0d0bd13
Merge pull request #249 from jkkummerfeld/master
neubig Jan 16, 2017
e950a9d
Fix mnist examples dependencies & add it to build path
pmichel31415 Jan 16, 2017
f30f422
More efficient colwise add
neubig Jan 16, 2017
a40aa0c
Merge pull request #250 from pmichel31415/mnist_example
neubig Jan 16, 2017
8b1fec4
Merge branch 'master' of https://github.com/clab/dynet
neubig Jan 16, 2017
39fc331
Bugfix in vanillalstm serialization
pmichel31415 Jan 17, 2017
0e32f31
Added tech report link
neubig Jan 17, 2017
62859dd
Merge pull request #251 from clab/serialization-vanillalstm-bugfix
neubig Jan 17, 2017
8896eff
Fixing MKL build for OS X
Jan 17, 2017
043c002
Updated name to match title of tech report
neubig Jan 17, 2017
870bef1
Merge pull request #254 from jkkummerfeld/master
neubig Jan 17, 2017
19c25d9
Added Mac installation instructions and eigen
alvations Jan 18, 2017
4929459
replace random sampling with argmax
emanjavacas Jan 18, 2017
c4ca3a4
vectorize attention weight loop
emanjavacas Jan 18, 2017
bf36c66
simplify dy ops
emanjavacas Jan 18, 2017
dc43961
Merge pull request #256 from alvations/patch-2
neubig Jan 18, 2017
991aa50
externalize w1dt computation and cache it
emanjavacas Jan 18, 2017
37ca2fb
Added multi-column support for softmax
neubig Jan 20, 2017
d3ac428
Updated doc for softmax
neubig Jan 20, 2017
95cac6b
Merge pull request #257 from emanjavacas/attn
neubig Jan 20, 2017
d4edbcb
Remove unnecessary tanh
pmichel31415 Jan 20, 2017
0118cc6
Fixed memory problem in columnwise softmax
neubig Jan 20, 2017
2a6419b
Merge branch 'master' of https://github.com/clab/dynet
neubig Jan 20, 2017
aea62d6
Refactor BiRNNBuilder to unify add_inputs and transduce. Also adds
bskaggs Jan 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# cmake stuff
build*/
Testing/
cnn/Testing/
cnn/tests.bin/
dynet/Testing/
dynet/tests.bin/
CTestTestfile.cmake
config.h
Makefile
CMakeCache.txt
CMakeFiles
cmake_install.cmake
python/dynet.cpp
python/dist/
python/dyNET.egg-info/

# binaries
examples/xor
examples/xor-xent
examples/rnnlm
examples/nlm

#data
rnnlm/ptb-mikolov/

# Python temporary files
*.pyc

# Compiled Object files
*.slo
Expand Down Expand Up @@ -44,5 +50,12 @@ examples/nlm
*.out
*.app

# Editor stuff
*.swp

# Doc stuff
doc/doxygen/xml
doc/source/tutorials_notebooks

.RData
.RHistory
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/easyloggingpp"]
path = external/easyloggingpp
url = https://github.com/easylogging/easyloggingpp.git
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: cpp
compiler:
- gcc

install:
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8

before_script:
- sudo add-apt-repository -y ppa:boost-latest/ppa
- sudo apt-get update -qq
- sudo apt-get install libboost-filesystem1.55-dev libboost-program-options1.55-dev libboost-serialization1.55-dev libboost-test1.55-dev libboost-regex1.55-dev
- hg clone https://bitbucket.org/eigen/eigen
- mkdir build
- cd build
- cmake .. -DEIGEN3_INCLUDE_DIR=eigen

script:
- make
- make test

159 changes: 137 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,83 @@
project(cnn)
project(dynet)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -O3 -g")

# DYNET uses Eigen which exploits modern CPU architectures. To get the
# best possible performance, the following are recommended:
# 1. use very recent versions of gcc or Clang to build
# 2. use very recent versions of Eigen (ideally the dev version)
# 3. try compiler options like -march=native or other architecture
# flags (the compiler does not always make the best configuration
# decisions without help)

# NOTE: This seems to be causing problems with linking before using
# make install. It is allegedly preferred, but probably doesn't
# suit our model of not installing the library most of the time.
set(CMAKE_MACOSX_RPATH 0)

function(find_mkl)
set(MKL_ARCH intel64)
find_path(MKL_INCLUDE_DIR mkl.h
PATHS ${MKL_ROOT} ${MKL_ROOT}/include)
find_library(MKL_CORE_LIB NAMES mkl_intel_lp64 mkl_intel_thread mkl_core
PATHS ${MKL_ROOT} ${MKL_ROOT}/lib/${MKL_ARCH}
${MKL_ROOT}/lib #OSX
DOC "MKL core library path")

find_library(MKL_COMPILER_LIB NAMES iomp5 libiomp5md
PATHS ${MKL_ROOT} ${MKL_ROOT}/../compiler/lib/${MKL_ARCH} #Windows
${MKL_ROOT}/../compilers_and_libraries/linux/lib/${MKL_ARCH}_lin #Linux
${MKL_ROOT}/../compilers_and_libraries/mac/lib #OSX
DOC "MKL compiler lib (for threaded MKL)")

if(MKL_INCLUDE_DIR AND MKL_CORE_LIB AND MKL_COMPILER_LIB)
get_filename_component(MKL_CORE_LIB_DIR ${MKL_CORE_LIB} DIRECTORY)
get_filename_component(MKL_COMPILER_LIB_DIR ${MKL_COMPILER_LIB} DIRECTORY)
get_filename_component(MKL_COMPILER_LIB_FILE ${MKL_COMPILER_LIB} NAME)
message(STATUS "Found MKL\n * include: ${MKL_INCLUDE_DIR},\n * core library dir: ${MKL_CORE_LIB_DIR},\n * compiler library: ${MKL_COMPILER_LIB}")

# Due to a conflict with /MT and /MD, MSVC needs mkl_intel_lp64 linked last, or we can change individual
# projects to use /MT (mkl_intel_lp64 linked with /MT, default MSVC projects use /MD), or we can instead
# link to the DLL versions. For now I'm opting for this solution which seems to work with projects still
# at their default /MD. Linux build requires the mkl_intel_lp64 to be linked first. So...:
if(MSVC)
set(LIBS ${LIBS} mkl_intel_thread mkl_core mkl_intel_lp64 ${MKL_COMPILER_LIB_FILE} PARENT_SCOPE)
else()
set(LIBS ${LIBS} mkl_intel_lp64 mkl_intel_thread mkl_core ${MKL_COMPILER_LIB_FILE} PARENT_SCOPE)
endif()
include_directories(${MKL_INCLUDE_DIR})
link_directories(${MKL_CORE_LIB_DIR} ${MKL_COMPILER_LIB_DIR})
set(MKL_LINK_DIRS ${MKL_CORE_LIB_DIR} ${MKL_COMPILER_LIB_DIR} PARENT_SCOPE) # Keeping this for python build
else()
message(FATAL_ERROR "Failed to find MKL in path: ${MKL_ROOT} (Did you set MKL_ROOT properly?)")
endif()
endfunction()

######## Cross-compiler, cross-platform options
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_FAST_MATH")
if (MKL OR MKL_ROOT)
find_mkl() # sets include/lib directories and sets ${LIBS} needed for linking
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_USE_MKL_ALL")
endif()


######## Platform-specific options
if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOMINMAX") # Disable min/max macros in windef.h
endif()

######## Compiler-specific options
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W1 -DEIGEN_HAS_C99_MATH /MP") # -Wall produces 20k warnings
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -funroll-loops -fno-finite-math-only -Wall -Wno-missing-braces -std=c++11 -Ofast -g -march=native")
endif()

enable_testing()

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/external/easyloggingpp/src)

function(find_cudnn)
set(CUDNN_ROOT "" CACHE PATH "CUDNN root path")
Expand All @@ -29,32 +100,76 @@ function(find_cudnn)
endfunction()

# look for Boost
find_package(Boost COMPONENTS program_options serialization unit_test_framework REQUIRED)
if(DEFINED ENV{BOOST_ROOT})
set(Boost_NO_SYSTEM_PATHS ON)
if(DEFINED ${Boost_INCLUDE_DIR})
get_filename_component(Boost_INCLUDE_DIR "${Boost_INCLUDE_DIR}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
endif()
endif()
set(Boost_REALPATH ON)
find_package(Boost COMPONENTS program_options regex serialization REQUIRED)
message("-- Boost dir is " ${Boost_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIR})
if(MSVC)
# Boost does auto-linking when using a compiler like Microsoft Visual C++, we just need to help it find the libraries
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LIBPATH:${Boost_LIBRARY_DIRS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LIBPATH:${Boost_LIBRARY_DIRS}")
else()
set(LIBS ${LIBS} ${Boost_LIBRARIES})
endif()
# trouble shooting:
# if boost library cannot be found, in addition to install boost library
# check if environment variables are set
#
# to set boost root and its library root in environment variable, use
# for example
# echo "export BOOST_LIBRARYDIR=/usr/local/lib" >> ~/.bashrc
# echo "export BOOST_ROOT=/cygdrive/d/tools/boost_1_58_0/boost_1_58_0" >> ~/.bashrc
# then run source ~/.bashrc to have those environment variable effective immediately

# look for Minerva
find_package(Minerva)
if(MINERVA_FOUND)
include_directories(${MINERVA_INCLUDE_DIR})
set(HAVE_MINERVA_H 1)
if (ENABLE_CUDA)
set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_ROOT})
find_package(CUDA REQUIRED)
include_directories(SYSTEM ${CUDA_INCLUDE_DIRS})
add_definitions(-DHAS_CUDA)
find_cudnn()
include_directories(SYSTEM ${CUDNN_INCLUDE_DIRS})
else ()
message(STATUS "CUDA not enabled (use -DENABLE_CUDA=1)")
endif()
endif(MINERVA_FOUND)
if(BACKEND)
message("-- BACKEND: ${BACKEND}")
else()
message("-- BACKEND not specified, defaulting to eigen.")
set(BACKEND "eigen")
endif()

if(BACKEND MATCHES "^eigen$")
set(WITH_EIGEN_BACKEND 1)
elseif(BACKEND MATCHES "^cuda$")
set(WITH_CUDA_BACKEND 1)
else()
message(SEND_ERROR "BACKEND must be eigen or cuda")
endif()

if (WITH_CUDA_BACKEND)
find_package(CUDA REQUIRED)
set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_ROOT})
include_directories(SYSTEM ${CUDA_INCLUDE_DIRS})
#list(APPEND CUDA_LIBRARIES /usr/lib64/libpthread.so)
MESSAGE("CUDA_LIBRARIES: ${CUDA_LIBRARIES}")
list(REMOVE_ITEM CUDA_LIBRARIES -lpthread)
set(LIBS ${LIBS} ${CUDA_LIBRARIES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_HAS_CUDA_FP16 -DEIGEN_USE_GPU")
#find_cudnn()
#include_directories(SYSTEM ${CUDNN_INCLUDE_DIRS})
endif()

# look for Eigen
find_package(Eigen3 REQUIRED)
get_filename_component(EIGEN3_INCLUDE_DIR "${EIGEN3_INCLUDE_DIR}" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
message("-- Eigen dir is " ${EIGEN3_INCLUDE_DIR})
include_directories(${EIGEN3_INCLUDE_DIR})

FIND_PACKAGE(Threads REQUIRED)
set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_subdirectory(cnn)
add_subdirectory(dynet)
add_subdirectory(tests)
add_subdirectory(examples)

add_subdirectory(tutorial)
add_subdirectory(python)
enable_testing()
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2015 Chris Dyer

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
10 changes: 10 additions & 0 deletions MEM.notes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The code that computes the l2 norm of the gradient is going to need
scratch space on every device that DYNET is using that has a parameter.
1) devices should know whether they have parameters/gradients

alignment code is hidden away. it's all hard coded, but it looks like
Intel at least is getting more foregiving about alingment problems so
we might not notice opportunities for speedups if something changes.
GPU memory is aligned mostly by CUDA

the MP stuff needs to be tested by Austin.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# cnn
C++ neural network library
# DyNet
The Dynamic Neural Network Toolkit

#### Building
DyNet (formerly known as [cnn](http://github.com/clab/cnn-v1)) 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](https://github.com/clab/lstm-parser), [machine translation](https://github.com/neubig/lamtram), [morphological inflection](https://github.com/mfaruqui/morph-trans), and many other application areas.

In `src`, you need to first use [`cmake`](http://www.cmake.org/) to generate the makefiles
Read the [documentation](http://dynet.readthedocs.io/en/latest/) to get started, and feel free to contact the [dynet-users group](https://groups.google.com/forum/#!forum/dynet-users) 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](http://github.com/clab/dynet).

cmake -DEIGEN3_INCLUDE_DIR=/Users/cdyer/software/eigen-eigen-36fd1ba04c12 -G 'Unix Makefiles'
You can also read more technical details in our [technical report](https://arxiv.org/abs/1701.03980). If you use DyNet for research, please cite this report as follows:

Then to compile, run

make -j 2
make test

If you want to see the compile commands that are used, you can run

make VERBOSE=1
@article{dynet,
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},
year={2017}
}

[![Build Status](https://travis-ci.org/clab/dynet.svg?branch=master)](https://travis-ci.org/clab/dynet)
[![Doc build Status](https://readthedocs.org/projects/dynet/badge/?version=latest)](http://dynet.readthedocs.io/en/latest/)
File renamed without changes.
9 changes: 9 additions & 0 deletions cmake/FindEigen3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
# EIGEN3_FOUND - system has eigen lib with correct version
# EIGEN3_INCLUDE_DIR - the eigen include directory
# EIGEN3_VERSION - eigen version
#
# This module reads hints about search locations from
# the following enviroment variables:
#
# EIGEN3_ROOT
# EIGEN3_ROOT_DIR

# Copyright (c) 2006, 2007 Montel Laurent, <[email protected]>
# Copyright (c) 2008, 2009 Gael Guennebaud, <[email protected]>
Expand Down Expand Up @@ -62,6 +68,9 @@ if (EIGEN3_INCLUDE_DIR)
else (EIGEN3_INCLUDE_DIR)

find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
HINTS
ENV EIGEN3_ROOT
ENV EIGEN3_ROOT_DIR
PATHS
${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR}
Expand Down
17 changes: 0 additions & 17 deletions cmake/FindMinerva.cmake

This file was deleted.

16 changes: 0 additions & 16 deletions cmake/FindTH++.cmake

This file was deleted.

Loading