提交 6bd89ba5 编写于 作者: T tensor-tang

fix typo

上级 1ea779ca
...@@ -82,7 +82,7 @@ inline void vec_tanh(const int n, const T* x, T* y) { ...@@ -82,7 +82,7 @@ inline void vec_tanh(const int n, const T* x, T* y) {
for (int i = 0; i < n; ++i) { for (int i = 0; i < n; ++i) {
y[i] = static_cast<T>(2) * x[i]; y[i] = static_cast<T>(2) * x[i];
} }
vec_exp<T>(n, y, y); vec_sigmoid<T>(n, y, y);
for (int i = 0; i < n; ++i) { for (int i = 0; i < n; ++i) {
y[i] = static_cast<T>(2) * y[i] - static_cast<T>(1); y[i] = static_cast<T>(2) * y[i] - static_cast<T>(1);
} }
......
...@@ -68,7 +68,7 @@ void RandomVec(const int n, T* a) { ...@@ -68,7 +68,7 @@ void RandomVec(const int n, T* a) {
std::mt19937 rng(seed++); std::mt19937 rng(seed++);
std::uniform_real_distribution<double> uniform_dist(0, 1); std::uniform_real_distribution<double> uniform_dist(0, 1);
const T lower = static_cast<T>(-20.f); const T lower = static_cast<T>(-20.f);
const T upper = static_cast<T>(-20.f); const T upper = static_cast<T>(20.f);
for (int i = 0; i < n; ++i) { for (int i = 0; i < n; ++i) {
a[i] = static_cast<T>(uniform_dist(rng) * (upper - lower) + lower); a[i] = static_cast<T>(uniform_dist(rng) * (upper - lower) + lower);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册