From 456564e3dae40245d43737abde9da929553b1d7e Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Tue, 28 Mar 2017 15:58:45 +0100 Subject: test commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 56d13ad5..03e73c2d 100644 --- a/README.md +++ b/README.md @@ -137,3 +137,5 @@ The setting above uses 8 CPU threads and 4 GPU threads (2 GPUs x 2 threads). The ## Acknowledgements The development of Amunmt received funding from the European Union's Horizon 2020 Research and Innovation Programme under grant agreements 688139 (SUMMA; 2016-2019) and 645487 (Modern MT; 2015-2017) and the Amazon Academic Research Awards program. + + -- cgit v1.2.3 From bf6f2af42aa4372159241b20927465ac5f9d3340 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Tue, 28 Mar 2017 16:02:37 +0100 Subject: test commit2 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 03e73c2d..95f69b99 100644 --- a/README.md +++ b/README.md @@ -139,3 +139,5 @@ The setting above uses 8 CPU threads and 4 GPU threads (2 GPUs x 2 threads). The The development of Amunmt received funding from the European Union's Horizon 2020 Research and Innovation Programme under grant agreements 688139 (SUMMA; 2016-2019) and 645487 (Modern MT; 2015-2017) and the Amazon Academic Research Awards program. + + -- cgit v1.2.3 From be29646511b8ffa5647995fd230454a92338b94c Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Tue, 28 Mar 2017 16:07:24 +0100 Subject: test commit3 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 95f69b99..b26af320 100644 --- a/README.md +++ b/README.md @@ -141,3 +141,4 @@ The development of Amunmt received funding from the European Union's Horizon 202 + -- cgit v1.2.3 From 434ad2453976c0adca429e96bdccd73bc5f16165 Mon Sep 17 00:00:00 2001 From: Tomasz Dwojak Date: Wed, 29 Mar 2017 10:31:49 +0000 Subject: Remove confusing warnings during loading no-LN model on cpu --- src/cpu/npz_converter.h | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/cpu/npz_converter.h b/src/cpu/npz_converter.h index 6bd2f692..7488ead7 100644 --- a/src/cpu/npz_converter.h +++ b/src/cpu/npz_converter.h @@ -12,55 +12,55 @@ class NpzConverter { public: NpyMatrixWrapper(const cnpy::NpyArray& npy) : npy_(npy) {} - + size_t size() const { return size1() * size2(); } - + float* data() const { return (float*)npy_.data; } - + float operator()(size_t i, size_t j) const { return ((float*)npy_.data)[i * size2() + j]; } - + size_t size1() const { return npy_.shape[0]; } - + size_t size2() const { if(npy_.shape.size() == 1) return 1; else - return npy_.shape[1]; + return npy_.shape[1]; } - + private: const cnpy::NpyArray& npy_; }; - + public: - + typedef blaze::CustomMatrix BlazeWrapper; - - + + NpzConverter(const std::string& file) : model_(cnpy::npz_load(file)), destructed_(false) { } - + ~NpzConverter() { if(!destructed_) model_.destruct(); } - + void Destruct() { model_.destruct(); destructed_ = true; } - + mblas::Matrix operator[](const std::string& key) const { BlazeWrapper matrix; auto it = model_.find(key); @@ -69,14 +69,16 @@ class NpzConverter { matrix = BlazeWrapper(np.data(), np.size1(), np.size2()); } else { - std::cerr << "Missing " << key << std::endl; + if (key.find("gamma") == std::string::npos) { + std::cerr << "Missing " << key << std::endl; + } } mblas::Matrix ret; ret = matrix; return std::move(ret); } - + mblas::Matrix operator()(const std::string& key, bool transpose) const { BlazeWrapper matrix; @@ -91,7 +93,7 @@ class NpzConverter { ret = matrix2; return std::move(ret); } - + private: cnpy::npz_t model_; bool destructed_; -- cgit v1.2.3 From 0097387283ec3c934317233aa94c7c477a4d5982 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Fri, 31 Mar 2017 11:48:54 +0100 Subject: LogSoftmax --- src/cpu/dl4mt/decoder.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/cpu/dl4mt/decoder.h b/src/cpu/dl4mt/decoder.h index 607d41d8..b1c10e97 100644 --- a/src/cpu/dl4mt/decoder.h +++ b/src/cpu/dl4mt/decoder.h @@ -182,14 +182,13 @@ class Decoder { auto t = blaze::forEach(T1_ + T2_ + T3_, Tanh()); if(!filtered_) { - Probs_ = t * w_.W4_; - AddBiasVector(Probs_, w_.B4_); + Probs = t * w_.W4_; + AddBiasVector(Probs, w_.B4_); } else { - Probs_ = t * FilteredW4_; - AddBiasVector(Probs_, FilteredB4_); + Probs = t * FilteredW4_; + AddBiasVector(Probs, FilteredB4_); } - mblas::Softmax(Probs_); - Probs = blaze::forEach(Probs_, Log()); + LogSoftmax(Probs); } void Filter(const std::vector& ids) { @@ -209,7 +208,6 @@ class Decoder { mblas::Matrix T1_; mblas::Matrix T2_; mblas::Matrix T3_; - mblas::Matrix Probs_; }; public: -- cgit v1.2.3