diff --git a/src/ccstruct/matrix.h b/src/ccstruct/matrix.h index 6feec22336..7dc1bb153b 100644 --- a/src/ccstruct/matrix.h +++ b/src/ccstruct/matrix.h @@ -365,7 +365,7 @@ class GENERIC_2D_ARRAY { } // Accumulates the element-wise sums of squares of src into *this. - void SumSquares(const GENERIC_2D_ARRAY& src, T decay_factor) { + void SumSquares(const GENERIC_2D_ARRAY& src, const T& decay_factor) { T update_factor = 1.0 - decay_factor; int size = num_elements(); for (int i = 0; i < size; ++i) { @@ -377,7 +377,7 @@ class GENERIC_2D_ARRAY { // Scales each element using the adam algorithm, ie array_[i] by // sqrt(sqsum[i] + epsilon)). void AdamUpdate(const GENERIC_2D_ARRAY& sum, - const GENERIC_2D_ARRAY& sqsum, T epsilon) { + const GENERIC_2D_ARRAY& sqsum, const T& epsilon) { int size = num_elements(); for (int i = 0; i < size; ++i) { array_[i] += sum.array_[i] / (sqrt(sqsum.array_[i]) + epsilon);