Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
NiuTrans.Tensor
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
杨迪
NiuTrans.Tensor
Commits
3a3b625a
Commit
3a3b625a
authored
Jul 18, 2018
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backward propagation for activation functions
parent
28f66400
隐藏空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
153 行增加
和
58 行删除
+153
-58
source/network/XBackwardFunc.cpp
+75
-0
source/network/XBackwardFunc.h
+14
-0
source/network/XNet.cpp
+6
-0
source/tensor/core/arithmetic/MatrixMul.cpp
+1
-1
source/tensor/function/Identity.cpp
+3
-3
source/tensor/function/Identity.h
+3
-3
source/tensor/function/Rectify.cpp
+4
-4
source/tensor/function/Rectify.cu
+3
-3
source/tensor/function/Rectify.cuh
+3
-3
source/tensor/function/Rectify.h
+3
-3
source/tensor/function/Sigmoid.cpp
+4
-4
source/tensor/function/Sigmoid.cu
+3
-3
source/tensor/function/Sigmoid.cuh
+3
-3
source/tensor/function/Sigmoid.h
+3
-3
source/tensor/function/Softmax.cpp
+5
-5
source/tensor/function/Softmax.cu
+4
-4
source/tensor/function/Softmax.cuh
+4
-4
source/tensor/function/Softmax.h
+4
-4
source/tensor/test/TIdentity.cpp
+2
-2
source/tensor/test/TRectify.cpp
+2
-2
source/tensor/test/TSigmoid.cpp
+2
-2
source/tensor/test/TSoftmax.cpp
+2
-2
没有找到文件。
source/network/XBackwardFunc.cpp
查看文件 @
3a3b625a
/* NiuTrans.Tensor - an open-source tensor library
* Copyright (C) 2018, Natural Language Processing Lab, Northestern University.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* backward computation for activation function
* $Created by: XIAO Tong (xiaotong@mail.neu.edu.cn) 2018-07-18
* Dingdang won 5 games in the GO training yesterday, hahaha ...
*/
#include "XNoder.h"
#include "XBackwardFunc.h"
#include "../tensor/XName.h"
#include "../tensor/function/FHeader.h"
namespace
nts
{
/* compute dE/dx of a node */
void
XFuncGrad
::
MakeGrad
(
XTensor
*
node
)
{
XLink
&
income
=
node
->
income
;
int
operID
=
income
.
typeID
;
CheckNTErrors
(
node
->
grad
!=
NULL
,
"No gradient found!"
);
CheckNTErrors
(
income
.
tailNum
==
1
,
"Too many input tensors for the function!"
);
XTensor
*
input
=
income
.
tails
[
0
];
XTensor
*
output
=
node
;
XNoder
::
MakeGrad
(
input
);
if
(
operID
==
FUNC_HARDTANH
)
_HardTanHBackward
(
NULL
,
output
,
input
,
output
->
grad
,
input
->
grad
,
NOLOSS
);
else
if
(
operID
==
FUNC_IDENTITY
)
_IdentityBackward
(
NULL
,
output
,
input
,
output
->
grad
,
input
->
grad
,
NOLOSS
);
else
if
(
operID
==
FUNC_LOGSOFTMAX
){
int
leadDim
=
income
.
GetParamInt
(
0
);
_LogSoftmaxBackward
(
NULL
,
output
,
input
,
output
->
grad
,
input
->
grad
,
leadDim
,
NOLOSS
);
}
else
if
(
operID
==
FUNC_RECTIFY
)
_RectifyBackward
(
NULL
,
output
,
input
,
output
->
grad
,
input
->
grad
,
NOLOSS
);
else
if
(
operID
==
FUNC_SIGMOID
)
_SigmoidBackward
(
NULL
,
output
,
input
,
output
->
grad
,
input
->
grad
,
NOLOSS
);
else
if
(
operID
==
FUNC_SOFTMAX
){
int
leadDim
=
income
.
GetParamInt
(
0
);
_SoftmaxBackward
(
NULL
,
output
,
input
,
output
->
grad
,
input
->
grad
,
leadDim
,
NOLOSS
);
}
else
{
ShowNTErrors
(
"Wrong activation function type!"
);
}
}
/* indicates whether the node is for an activation function */
bool
XFuncGrad
::
IsFunc
(
XTensor
*
node
)
{
XLink
&
income
=
node
->
income
;
return
(
income
.
typeID
&
FUNCTION_BASE
)
!=
0
;
}
}
source/network/XBackwardFunc.h
查看文件 @
3a3b625a
...
...
@@ -29,6 +29,19 @@
namespace
nts
{
/* this class computes the gradient for activation functions given a node */
class
XFuncGrad
{
public
:
/* compute dE/dx of a node */
static
void
MakeGrad
(
XTensor
*
node
);
/* indicates whether the node is for an activation function */
static
bool
IsFunc
(
XTensor
*
node
);
};
}
#endif
\ No newline at end of file
source/network/XNet.cpp
查看文件 @
3a3b625a
...
...
@@ -23,6 +23,7 @@
#include "XNoder.h"
#include "XBackwardLoss.h"
#include "XBackwardMath.h"
#include "XBackwardFunc.h"
#include "../tensor/XName.h"
namespace
nts
{
...
...
@@ -143,6 +144,11 @@ void XNet::BackwardNode(XTensor * node)
if
(
!
XNoder
::
IsLeaf
(
node
)){
if
(
XMathGrad
::
IsMathOP
(
node
))
XMathGrad
::
MakeGrad
(
node
);
else
if
(
XFuncGrad
::
IsFunc
(
node
))
XFuncGrad
::
MakeGrad
(
node
);
else
{
ShowNTErrors
(
"Wrong node type!"
);
}
}
node
->
visitMark
=
NODE_FINISHED
;
...
...
source/tensor/core/arithmetic/MatrixMul.cpp
查看文件 @
3a3b625a
...
...
@@ -208,7 +208,7 @@ Obviously C = A * B performs normal matrix multiplication if A = y * z and B = x
<< return - the result of matrix multiplication
*/
XTensor
MatrixMul
(
const
XTensor
&
a
,
MATRIX_TRANS_TYPE
transposedA
,
const
XTensor
&
b
,
MATRIX_TRANS_TYPE
transposedB
,
DTYPE
alpha
,
DTYPE
beta
,
XPRunner
*
parallelRunner
)
DTYPE
alpha
,
DTYPE
beta
,
XPRunner
*
parallelRunner
)
{
CheckNTErrors
(
&
a
!=
&
NULLTensor
&&
&
b
!=
&
NULLTensor
,
"Empty input tensors!"
);
CheckNTErrors
(
a
.
dataType
==
b
.
dataType
,
"Input tensors should have the same data type!"
);
...
...
source/tensor/function/Identity.cpp
查看文件 @
3a3b625a
...
...
@@ -47,9 +47,9 @@ dE/dx = dE/dy * dy/dx = dE/dy
>> dedx - dE/dx
>> lossName - type of loss function, e.g., cross entropy
*/
void
IdentityBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
)
void
_
IdentityBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
)
{
CheckNTErrors
((
gold
==
NULL
||
XTensor
::
IsIdentical
(
gold
,
y
)),
"The tensors must be of the same size!"
);
...
...
source/tensor/function/Identity.h
查看文件 @
3a3b625a
...
...
@@ -33,9 +33,9 @@ void _Identity(const XTensor * x, XTensor * y);
/* de/dx */
extern
"C"
void
IdentityBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
);
void
_
IdentityBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
);
}
// namespace nts(NiuTrans.Tensor)
...
...
source/tensor/function/Rectify.cpp
查看文件 @
3a3b625a
...
...
@@ -76,16 +76,16 @@ rectified: y = 0 if x < 0
>> dedx - dE/dx
>> lossName - type of loss function, e.g., cross entropy
*/
void
RectifyBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
)
void
_
RectifyBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
)
{
CheckNTErrors
((
gold
==
NULL
||
XTensor
::
IsIdentical
(
gold
,
y
)),
"The tensors must be of the same size!"
);
#ifdef USE_CUDA
if
(
x
->
devID
>=
0
||
y
->
devID
>=
0
){
CudaRectifyBackward
(
gold
,
y
,
x
,
dedy
,
dedx
,
lossName
);
_
CudaRectifyBackward
(
gold
,
y
,
x
,
dedy
,
dedx
,
lossName
);
return
;
}
#endif
...
...
source/tensor/function/Rectify.cu
查看文件 @
3a3b625a
...
...
@@ -126,9 +126,9 @@ rectify : y = s if s >= 0
>> oBeg - where to start in the model output (along the leading dimension)
>> parallelRunner - parallel processing module
*/
void CudaRectifyBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
LOSS_FUNCTION_NAME lossName)
void
_
CudaRectifyBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
LOSS_FUNCTION_NAME lossName)
{
if(x->dataType == DEFAULT_DTYPE && y->dataType == DEFAULT_DTYPE){
...
...
source/tensor/function/Rectify.cuh
查看文件 @
3a3b625a
...
...
@@ -35,9 +35,9 @@ void _CudaRectify(const XTensor * input, XTensor * output);
/* de/dx (Cuda version) */
extern "C"
void CudaRectifyBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
LOSS_FUNCTION_NAME lossName);
void
_
CudaRectifyBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
LOSS_FUNCTION_NAME lossName);
#endif // USE_CUDA
...
...
source/tensor/function/Rectify.h
查看文件 @
3a3b625a
...
...
@@ -33,9 +33,9 @@ void _Rectify(const XTensor * x, XTensor * y);
/* de/dx */
extern
"C"
void
RectifyBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
);
void
_
RectifyBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
);
}
// namespace nts(NiuTrans.Tensor)
...
...
source/tensor/function/Sigmoid.cpp
查看文件 @
3a3b625a
...
...
@@ -68,16 +68,16 @@ sigmoid: y = 1/(1+exp(-x))
>> dedx - dE/dx
>> lossName - type of loss function, e.g., cross entropy
*/
void
SigmoidBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
)
void
_
SigmoidBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
)
{
CheckNTErrors
((
gold
==
NULL
||
XTensor
::
IsIdentical
(
gold
,
y
)),
"The tensors must be of the same size!"
);
#ifdef USE_CUDA
if
(
x
->
devID
>=
0
||
y
->
devID
>=
0
){
CudaSigmoidBackward
(
gold
,
y
,
x
,
dedy
,
dedx
,
lossName
);
_
CudaSigmoidBackward
(
gold
,
y
,
x
,
dedy
,
dedx
,
lossName
);
return
;
}
#endif
...
...
source/tensor/function/Sigmoid.cu
查看文件 @
3a3b625a
...
...
@@ -122,9 +122,9 @@ sigmoid: y = 1/(1+exp(-x))
>> dedx - dE/dx
>> lossName - type of loss function, e.g., cross entropy
*/
void CudaSigmoidBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
LOSS_FUNCTION_NAME lossName)
void
_
CudaSigmoidBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
LOSS_FUNCTION_NAME lossName)
{
if(x->dataType == DEFAULT_DTYPE && y->dataType == DEFAULT_DTYPE){
/* calculate dE/dy */
...
...
source/tensor/function/Sigmoid.cuh
查看文件 @
3a3b625a
...
...
@@ -35,9 +35,9 @@ void _CudaSigmoid(const XTensor * input, XTensor * output);
/* de/dx (Cuda version) */
extern "C"
void CudaSigmoidBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
LOSS_FUNCTION_NAME lossName);
void
_
CudaSigmoidBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
LOSS_FUNCTION_NAME lossName);
#endif // USE_CUDA
...
...
source/tensor/function/Sigmoid.h
查看文件 @
3a3b625a
...
...
@@ -33,9 +33,9 @@ void _Sigmoid(const XTensor * x, XTensor * y);
/* de/dx */
extern
"C"
void
SigmoidBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
);
void
_
SigmoidBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
LOSS_FUNCTION_NAME
lossName
);
}
// namespace nts(NiuTrans.Tensor)
...
...
source/tensor/function/Softmax.cpp
查看文件 @
3a3b625a
...
...
@@ -154,10 +154,10 @@ See more details in LogSoftmaxBackward(...)
>> lossName - type of loss function, e.g., cross entropy
>> leadDim - leading dimension (along which we perform reduction)
*/
void
SoftmaxBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
int
leadDim
,
LOSS_FUNCTION_NAME
lossName
)
void
_
SoftmaxBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
int
leadDim
,
LOSS_FUNCTION_NAME
lossName
)
{
CheckNTErrors
((
dedx
->
isSparse
==
false
),
"The gradient tensor must be dense!"
);
CheckNTErrors
((
gold
!=
NULL
),
"Incorrect x gold standard tensor!"
);
...
...
@@ -165,7 +165,7 @@ void SoftmaxBackward(XTensor * gold, XTensor * y, XTensor * x,
int
leadDimRDI
=
y
->
order
-
leadDim
-
1
;
#ifdef USE_CUDA
if
(
y
->
devID
>=
0
){
CudaSoftmaxBackward
(
gold
,
y
,
x
,
dedy
,
dedx
,
leadDim
,
lossName
);
_
CudaSoftmaxBackward
(
gold
,
y
,
x
,
dedy
,
dedx
,
leadDim
,
lossName
);
return
;
}
#endif
...
...
source/tensor/function/Softmax.cu
查看文件 @
3a3b625a
...
...
@@ -230,10 +230,10 @@ See more details in SoftmaxBackward
>> lossName - type of loss function, e.g., cross entropy
>> leadDim - leading dimension (along which we perform reduction)
*/
void CudaSoftmaxBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
int leadDim,
LOSS_FUNCTION_NAME lossName)
void
_
CudaSoftmaxBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
int leadDim,
LOSS_FUNCTION_NAME lossName)
{
CheckNTErrors((x->devID >= 0), "Backward computation of log softmax must be run on GPUs.");
CheckNTErrors((x->devID == y->devID), "Matrices used in log softmax are not on the same GPU.");
...
...
source/tensor/function/Softmax.cuh
查看文件 @
3a3b625a
...
...
@@ -39,10 +39,10 @@ void _CudaSoftmaxSumMax(const XTensor * x, XTensor * y, int leadDim, XTensor * s
/* de/dx (Cuda version) */
extern "C"
void CudaSoftmaxBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
int leadDim,
LOSS_FUNCTION_NAME lossName);
void
_
CudaSoftmaxBackward(XTensor * gold, XTensor * y, XTensor * x,
XTensor * dedy, XTensor * dedx,
int leadDim,
LOSS_FUNCTION_NAME lossName);
#endif // USE_CUDA
...
...
source/tensor/function/Softmax.h
查看文件 @
3a3b625a
...
...
@@ -33,10 +33,10 @@ void _Softmax(const XTensor * x, XTensor * y, int leadDim);
/* de/dx */
extern
"C"
void
SoftmaxBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
int
leadDim
,
LOSS_FUNCTION_NAME
lossName
);
void
_
SoftmaxBackward
(
XTensor
*
gold
,
XTensor
*
y
,
XTensor
*
x
,
XTensor
*
dedy
,
XTensor
*
dedx
,
int
leadDim
,
LOSS_FUNCTION_NAME
lossName
);
}
// namespace nts(NiuTrans.Tensor)
...
...
source/tensor/test/TIdentity.cpp
查看文件 @
3a3b625a
...
...
@@ -142,7 +142,7 @@ bool TestIdentity2()
_Identity
(
x
,
y
);
/* call IdentityBackward function */
IdentityBackward
(
g
,
y
,
x
,
dedy
,
dedx
,
CROSSENTROPY
);
_
IdentityBackward
(
g
,
y
,
x
,
dedy
,
dedx
,
CROSSENTROPY
);
/* check result */
cpuTest
=
y
->
CheckData
(
yAnswer
,
unitNum
,
1e-4
F
)
...
...
@@ -171,7 +171,7 @@ bool TestIdentity2()
_Identity
(
xGPU
,
yGPU
);
/* call IdentityBackward function */
IdentityBackward
(
gGPU
,
yGPU
,
xGPU
,
dedyGPU
,
dedxGPU
,
CROSSENTROPY
);
_
IdentityBackward
(
gGPU
,
yGPU
,
xGPU
,
dedyGPU
,
dedxGPU
,
CROSSENTROPY
);
/* check result */
gpuTest
=
yGPU
->
CheckData
(
yAnswer
,
unitNum
,
1e-4
F
)
...
...
source/tensor/test/TRectify.cpp
查看文件 @
3a3b625a
...
...
@@ -147,7 +147,7 @@ bool TestRectify2()
_Rectify
(
x
,
y
);
/* call RectifyBackward function */
RectifyBackward
(
gold
,
y
,
x
,
dedy
,
dedx
,
CROSSENTROPY
);
_
RectifyBackward
(
gold
,
y
,
x
,
dedy
,
dedx
,
CROSSENTROPY
);
/* check results */
cpuTest
=
y
->
CheckData
(
yAnswer
,
unitNum
,
1e-4
F
)
...
...
@@ -176,7 +176,7 @@ bool TestRectify2()
_Rectify
(
xGPU
,
yGPU
);
/* call rectifybackward function */
RectifyBackward
(
goldGPU
,
yGPU
,
xGPU
,
dedyGPU
,
dedxGPU
,
CROSSENTROPY
);
_
RectifyBackward
(
goldGPU
,
yGPU
,
xGPU
,
dedyGPU
,
dedxGPU
,
CROSSENTROPY
);
/* check results */
gpuTest
=
yGPU
->
CheckData
(
yAnswer
,
unitNum
,
1e-4
F
)
...
...
source/tensor/test/TSigmoid.cpp
查看文件 @
3a3b625a
...
...
@@ -141,7 +141,7 @@ bool TestSigmoid2()
_Sigmoid
(
x
,
y
);
/* call SigmoidBackward function */
SigmoidBackward
(
g
,
y
,
x
,
dedy
,
dedx
,
CROSSENTROPY
);
_
SigmoidBackward
(
g
,
y
,
x
,
dedy
,
dedx
,
CROSSENTROPY
);
/* check result */
cpuTest
=
y
->
CheckData
(
yAnswer
,
unitNum
,
1e-4
F
)
...
...
@@ -170,7 +170,7 @@ bool TestSigmoid2()
_Sigmoid
(
xGPU
,
yGPU
);
/* call SigmoidBackward function */
SigmoidBackward
(
gGPU
,
yGPU
,
xGPU
,
dedyGPU
,
dedxGPU
,
CROSSENTROPY
);
_
SigmoidBackward
(
gGPU
,
yGPU
,
xGPU
,
dedyGPU
,
dedxGPU
,
CROSSENTROPY
);
/* check result */
gpuTest
=
yGPU
->
CheckData
(
yAnswer
,
unitNum
,
1e-4
F
)
...
...
source/tensor/test/TSoftmax.cpp
查看文件 @
3a3b625a
...
...
@@ -142,7 +142,7 @@ bool TestSoftmax2()
_Softmax
(
x
,
y
,
1
);
/* call SoftmaxBackward function */
SoftmaxBackward
(
g
,
y
,
x
,
dedy
,
dedx
,
1
,
CROSSENTROPY
);
_
SoftmaxBackward
(
g
,
y
,
x
,
dedy
,
dedx
,
1
,
CROSSENTROPY
);
/* check result */
cpuTest
=
y
->
CheckData
(
yAnswer
,
unitNum
,
1e-4
F
)
...
...
@@ -170,7 +170,7 @@ bool TestSoftmax2()
_Softmax
(
xGPU
,
yGPU
,
1
);
/* call SoftmaxBackward function */
SoftmaxBackward
(
gGPU
,
yGPU
,
xGPU
,
dedyGPU
,
dedxGPU
,
1
,
CROSSENTROPY
);
_
SoftmaxBackward
(
gGPU
,
yGPU
,
xGPU
,
dedyGPU
,
dedxGPU
,
1
,
CROSSENTROPY
);
/* check result */
gpuTest
=
yGPU
->
CheckData
(
yAnswer
,
unitNum
,
1e-4
F
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论