We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
代码如下
Matrix *M_Relu(Matrix *_mat_origin) {/* * Absolute the value of elements in the Matrix (create). * 矩阵所有元素取Relu函数值,大于0不变,小于0赋值0*/ Matrix *_mat = (Matrix *) malloc(sizeof(Matrix)); _mat->row = _mat_origin->row; _mat->column = _mat_origin->column; int size = _mat->row * _mat->column; _mat->data = (MATRIX_TYPE *) malloc((size) * sizeof(MATRIX_TYPE)); int i; for (i = 0; i < size; i++) { if(_mat_origin->data[i]<0) { _mat->data[i] = 0; continue; } _mat->data[i] = _mat_origin->data[i]; } return _mat; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
代码如下
The text was updated successfully, but these errors were encountered: