提交 cac4ad44 编写于 作者: C caoying03

delete useless codes in softmax backward.

上级 56faf513
...@@ -112,7 +112,6 @@ BEGIN_DEFINE_ACTIVATION(softmax) ...@@ -112,7 +112,6 @@ BEGIN_DEFINE_ACTIVATION(softmax)
private: private:
MatrixPtr sftMaxSum_; MatrixPtr sftMaxSum_;
MatrixPtr sftMaxDot_; MatrixPtr sftMaxDot_;
MatrixPtr one_;
public: public:
Error __must_check forward(Argument& act) { Error __must_check forward(Argument& act) {
...@@ -138,14 +137,6 @@ Error __must_check backward(Argument& act) { ...@@ -138,14 +137,6 @@ Error __must_check backward(Argument& act) {
1, 1,
/* trans */ false, /* trans */ false,
useGpu(act.deviceId)); useGpu(act.deviceId));
if (!one_ || one_->getWidth() != outputG->getWidth()) {
Matrix::resizeOrCreate(one_,
1,
outputG->getWidth(),
/* trans */ false,
useGpu(act.deviceId));
one_->one();
}
sftMaxDot_->dotMul(*outputG, *outputV); sftMaxDot_->dotMul(*outputG, *outputV);
sftMaxSum_->colMerge(*sftMaxDot_); sftMaxSum_->colMerge(*sftMaxDot_);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册