mirror of
https://github.com/marian-nmt/marian.git
synced 2024-09-17 09:47:34 +03:00
Fixed fp16 training/inference with factors-combine concat (#926)
This commit is contained in:
parent
78bef7aeba
commit
23c36ec1a3
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
### Fixed
|
### Fixed
|
||||||
- Scripts using PyYAML now use `safe_load`; see https://msg.pyyaml.org/load
|
- Scripts using PyYAML now use `safe_load`; see https://msg.pyyaml.org/load
|
||||||
- Fixed check for `fortran_ordering` in cnpy
|
- Fixed check for `fortran_ordering` in cnpy
|
||||||
|
- Fixed fp16 training/inference with factors-combine concat method
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Make guided-alignment faster via sparse memory layout, add alignment points for EOS, remove losses other than ce
|
- Make guided-alignment faster via sparse memory layout, add alignment points for EOS, remove losses other than ce
|
||||||
|
@ -57,8 +57,7 @@ Embedding::Embedding(Ptr<ExpressionGraph> graph, Ptr<Options> options)
|
|||||||
auto lemmaEmbs = rows(E_, lemmaIndices);
|
auto lemmaEmbs = rows(E_, lemmaIndices);
|
||||||
int dimFactors = FactorEmbMatrix_->shape()[0];
|
int dimFactors = FactorEmbMatrix_->shape()[0];
|
||||||
auto factEmbs
|
auto factEmbs
|
||||||
= dot(graph->constant(
|
= dot(graph->constant({(int)data.size(), dimFactors}, inits::fromVector(factorIndices)),
|
||||||
{(int)data.size(), dimFactors}, inits::fromVector(factorIndices), Type::float32),
|
|
||||||
FactorEmbMatrix_);
|
FactorEmbMatrix_);
|
||||||
|
|
||||||
return concatenate({lemmaEmbs, factEmbs}, -1);
|
return concatenate({lemmaEmbs, factEmbs}, -1);
|
||||||
|
Loading…
Reference in New Issue
Block a user