Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcin Junczys-Dowmunt <marcinjd@microsoft.com>2021-02-12 07:39:13 +0300
committerMarcin Junczys-Dowmunt <marcinjd@microsoft.com>2021-02-12 07:39:13 +0300
commit93cdfdcc9a228a0932b9a1691a48a6ced875f160 (patch)
tree252364d7c82aea28d2bd97338fe2b8ac1d371aef /src
parent80b74b844142470ac3e5f6e056af69a1afc9ed38 (diff)
enable marian-tgz building for non-static build, fix small dropout bug
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt46
-rwxr-xr-xsrc/layers/generic.cpp16
2 files changed, 30 insertions, 32 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dce4cb03..b47663b4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -222,30 +222,28 @@ if (NOT COMPILE_LIBRARY_ONLY)
# execution in MSFT internal tools FLO and Philly.
# For Philly submission, we need statically-linked versions to deal with
# library dependencies, so this target is only enabled for static builds.
- if(USE_STATIC_LIBS)
- add_custom_command(
- OUTPUT "${CMAKE_BINARY_DIR}/marian.zip"
- COMMAND zip -v -0 -j "${CMAKE_BINARY_DIR}/marian.zip"
- "${CMAKE_BINARY_DIR}/marian"
- "${CMAKE_BINARY_DIR}/marian-decoder"
- "${CMAKE_BINARY_DIR}/marian-scorer"
- "${CMAKE_BINARY_DIR}/marian-vocab"
- "${CMAKE_BINARY_DIR}/marian-conv"
- DEPENDS marian_train marian_decoder marian_scorer marian_vocab marian_conv)
- add_custom_target(marian_zip DEPENDS "${CMAKE_BINARY_DIR}/marian.zip")
-
- add_custom_command(
- OUTPUT "${CMAKE_BINARY_DIR}/marian.tgz"
- COMMAND tar -cvvzf "${CMAKE_BINARY_DIR}/marian.tgz" -C "${CMAKE_BINARY_DIR}"
- "marian"
- "marian-decoder"
- "marian-scorer"
- "marian-vocab"
- "marian-conv"
- DEPENDS marian_train marian_decoder marian_scorer marian_vocab marian_conv)
- add_custom_target(marian_tgz DEPENDS "${CMAKE_BINARY_DIR}/marian.tgz")
- add_custom_target(philly DEPENDS marian_tgz marian_zip)
- endif(USE_STATIC_LIBS)
+ add_custom_command(
+ OUTPUT "${CMAKE_BINARY_DIR}/marian.zip"
+ COMMAND zip -v -0 -j "${CMAKE_BINARY_DIR}/marian.zip"
+ "${CMAKE_BINARY_DIR}/marian"
+ "${CMAKE_BINARY_DIR}/marian-decoder"
+ "${CMAKE_BINARY_DIR}/marian-scorer"
+ "${CMAKE_BINARY_DIR}/marian-vocab"
+ "${CMAKE_BINARY_DIR}/marian-conv"
+ DEPENDS marian_train marian_decoder marian_scorer marian_vocab marian_conv)
+ add_custom_target(marian_zip DEPENDS "${CMAKE_BINARY_DIR}/marian.zip")
+
+ add_custom_command(
+ OUTPUT "${CMAKE_BINARY_DIR}/marian.tgz"
+ COMMAND tar -cvvzf "${CMAKE_BINARY_DIR}/marian.tgz" -C "${CMAKE_BINARY_DIR}"
+ "marian"
+ "marian-decoder"
+ "marian-scorer"
+ "marian-vocab"
+ "marian-conv"
+ DEPENDS marian_train marian_decoder marian_scorer marian_vocab marian_conv)
+ add_custom_target(marian_tgz DEPENDS "${CMAKE_BINARY_DIR}/marian.tgz")
+ add_custom_target(philly DEPENDS marian_tgz marian_zip)
if(COMPILE_SERVER)
add_executable(marian_server command/marian_server.cpp)
diff --git a/src/layers/generic.cpp b/src/layers/generic.cpp
index 0a1e6d48..62752285 100755
--- a/src/layers/generic.cpp
+++ b/src/layers/generic.cpp
@@ -559,13 +559,13 @@ namespace marian {
// standard encoder word embeddings
/*private*/ Ptr<IEmbeddingLayer> EncoderDecoderLayerBase::createEmbeddingLayer() const {
auto options = New<Options>(
- "dimVocab", opt<std::vector<int>>("dim-vocabs")[batchIndex_],
- "dimEmb", opt<int>("dim-emb"),
- "dropout-embeddings", dropoutEmbeddings_,
- "inference", inference_,
- "prefix", (opt<bool>("tied-embeddings-src") || opt<bool>("tied-embeddings-all")) ? "Wemb" : prefix_ + "_Wemb",
- "fixed", embeddingFix_,
- "vocab", opt<std::vector<std::string>>("vocabs")[batchIndex_]); // for factored embeddings
+ "dimVocab", opt<std::vector<int>>("dim-vocabs")[batchIndex_],
+ "dimEmb", opt<int>("dim-emb"),
+ "dropout", dropoutEmbeddings_,
+ "inference", inference_,
+ "prefix", (opt<bool>("tied-embeddings-src") || opt<bool>("tied-embeddings-all")) ? "Wemb" : prefix_ + "_Wemb",
+ "fixed", embeddingFix_,
+ "vocab", opt<std::vector<std::string>>("vocabs")[batchIndex_]); // for factored embeddings
if(options_->hasAndNotEmpty("embedding-vectors")) {
auto embFiles = opt<std::vector<std::string>>("embedding-vectors");
options->set(
@@ -583,7 +583,7 @@ namespace marian {
"dimUlrEmb", opt<int>("ulr-dim-emb"),
"dimEmb", opt<int>("dim-emb"),
"ulr-dropout", opt<float>("ulr-dropout"),
- "dropout-embeddings", dropoutEmbeddings_,
+ "dropout", dropoutEmbeddings_,
"inference", inference_,
"ulrTrainTransform", opt<bool>("ulr-trainable-transformation"),
"ulrQueryFile", opt<std::string>("ulr-query-vectors"),