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/graph
diff options
context:
space:
mode:
authorFrank Seide <fseide@microsoft.com>2019-01-31 02:29:16 +0300
committerFrank Seide <fseide@microsoft.com>2019-01-31 02:29:16 +0300
commitb117996c0357b7a372756c08b4d87287dc1dd8fb (patch)
tree25b6b3165ae96e6622b62feadd2014e108b07532 /src/graph
parentfde5f647bb5cfdf969b9f0d400ac223284120654 (diff)
Output now creates its own W matrix in transposed form
Diffstat (limited to 'src/graph')
-rwxr-xr-xsrc/graph/expression_graph.h7
-rwxr-xr-xsrc/graph/node_initializers.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/graph/expression_graph.h b/src/graph/expression_graph.h
index fe836161..22908d96 100755
--- a/src/graph/expression_graph.h
+++ b/src/graph/expression_graph.h
@@ -316,6 +316,13 @@ public:
dot.close();
}
+ Expr tryFindParam(const std::string& pname) const {
+ std::string name = pname;
+ if(!namespace_.empty())
+ name = namespace_ + "::" + name;
+ return params_->get(name);
+ }
+
Expr param(const std::string& pname,
const Shape& shape,
const NodeInitializer& init,
diff --git a/src/graph/node_initializers.cpp b/src/graph/node_initializers.cpp
index f405102e..b2550c54 100755
--- a/src/graph/node_initializers.cpp
+++ b/src/graph/node_initializers.cpp
@@ -195,7 +195,7 @@ NodeInitializer from_item(const io::Item& item) {
NodeInitializer sinusoidalPositionEmbeddings(int start) {
return [start](Tensor t) {
int dimEmb = t->shape()[-1];
- int dimWords = t->size() / dimEmb;
+ int dimWords = (int)t->size() / dimEmb;
float numTimescales = (float)dimEmb / 2;
float logTimescaleIncrement = std::log(10000.f) / (numTimescales - 1.f);