hassygo / n3lp Goto Github PK
View Code? Open in Web Editor NEWC++ implementation for Neural Network-based NLP, such as LSTM machine translation!
License: MIT License
C++ implementation for Neural Network-based NLP, such as LSTM machine translation!
License: MIT License
I am trying to compile this on Mac OSX Yosemite but I keep getting an error about omp.h
file. I googled and found some suggestion to use different g++ version instead of the default on Mac, but even if I use g++-4.9 or g++-6, it still does not work.
Error message when using default g++:
g++ -c -O3 -std=c++0x -lm -funroll-loops -march=native -m64 -DEIGEN_DONT_PARALLELIZE -DEIGEN_NO_DEBUG -DEIGEN_NO_STATIC_ASSERT -I$HOME/tools/eigen -fopenmp -o objs/EncDec.o EncDec.cpp
clang: warning: -lm: 'linker' input unused
EncDec.cpp:6:10: fatal error: 'omp.h' file not found
#include <omp.h>
^
1 error generated.
make: *** [objs/EncDec.o] Error 1
Error message when using g++-6:
Utils.hpp: In function 'void Utils::infNan(const Real&)':
Utils.hpp:69:19: error: invalid initialization of reference of type 'const Eigen::half&' from expression of type 'const Real {aka const double}'
assert(!isnan(x) && !isinf(x));
^
In file included from /Users/nguyenlab-imac/tools/eigen/Eigen/Core:356:0,
from Matrix.hpp:3,
from LSTM.hpp:3,
from EncDec.hpp:3,
from EncDec.cpp:1:
Do you know how to fix this issue?
I have a question about the calculation in LSTM::forward.
In your implementation, each gate is calculated as follows:
cur->i = this->bi + this->Wxi_xt + this->Whi_prev->h;
where there are 2 summations, current x and previous h.
But in most papers I read, for example this: ftp://ftp.idsia.ch/pub/juergen/nn_2005.pdf (page 7)
and this (page 46),
each gate consists of 3 summations, which are current x, previous h and previous cell state (c in your implementation).
Could you tell me why cur->i is not added by previous cell state (c) ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.