Repository: systemml Updated Branches: refs/heads/master cb58c7c16 -> 31580f52d
[SYSTEMML-2325] Fix result correctness bias_add over sparse input This patch fixes a result correctness issue of the custom bias_add operation over sparse inputs. This operation used the copy primitive to take over dense/sparse inputs and subsequently add the bias terms to the dense output. However, if the input was in sparse format, this led to switching the output format to sparse such that the bias terms were added to a discarded dense block and thus lost. We now ensure that the output is preserved in dense format, which is likely the case for this additive operation. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/b4dedfeb Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/b4dedfeb Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/b4dedfeb Branch: refs/heads/master Commit: b4dedfeb7291311491d8a48f9c4681007cd2366c Parents: cb58c7c Author: Matthias Boehm <[email protected]> Authored: Mon May 14 18:06:22 2018 -0700 Committer: Matthias Boehm <[email protected]> Committed: Mon May 14 18:06:22 2018 -0700 ---------------------------------------------------------------------- .../java/org/apache/sysml/runtime/matrix/data/LibMatrixDNN.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/b4dedfeb/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNN.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNN.java b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNN.java index 17dbdc0..e980246 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNN.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNN.java @@ -312,7 +312,7 @@ public class LibMatrixDNN { } else { // Handles both dense and sparse inputs and copies it to dense output - outputBlock.copy(input); + outputBlock.copy(input, false); int index = 0; if(bias.isInSparseFormat()) bias.sparseToDense(); // Since bias is extremely small array
