[ https://issues.apache.org/jira/browse/SYSTEMML-619?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Dusenberry closed SYSTEMML-619. ------------------------------------ > Same usage of same random matrix leads to different results > ----------------------------------------------------------- > > Key: SYSTEMML-619 > URL: https://issues.apache.org/jira/browse/SYSTEMML-619 > Project: SystemML > Issue Type: Bug > Affects Versions: SystemML 0.9, SystemML 0.10 > Reporter: Mike Dusenberry > Assignee: Matthias Boehm > Fix For: SystemML 0.9, SystemML 0.10 > > > Interesting bug, as of [commit e16fe1d | > https://github.com/apache/incubator-systemml/commit/e16fe1df586371408a9dc3de29b13c98982ff57c]: > Start by creating a random matrix {{X}}, multiplying it by 2 and assigning to > a variable {{dX}}, and then print the results: > {code} > # Generate data > N = 3 > D = 2 > X = rand(rows=N, cols=D) > # Function > dX = 2 * X > # Print elements of dX > for (i in 1:nrow(dX)) { > for (j in 1:ncol(dX)) { > print("dX["+i+","+j+"]: " + as.scalar(dX[i,j])) > } > } > print("") > print("") > print("") > print("") > {code} > Output: > {code} > dX[1,1]: 1.0743268190621265 > dX[1,2]: 1.403590780383033 > dX[2,1]: 1.9404746268735837 > dX[2,2]: 0.8689030633611705 > dX[3,1]: 0.2589227727050818 > dX[3,2]: 0.342402157694327 > {code} > Now, copy and paste the assignment to {{dX}} and the print statement, thus > literally repeating the same code again. > {code} > # Generate data > N = 3 > D = 2 > X = rand(rows=N, cols=D) > # Function > dX = 2 * X > # Print elements of dX > for (i in 1:nrow(dX)) { > for (j in 1:ncol(dX)) { > print("dX["+i+","+j+"]: " + as.scalar(dX[i,j])) > } > } > print("") > # Function > dX = 2 * X > # Print elements of dX > for (i in 1:nrow(dX)) { > for (j in 1:ncol(dX)) { > print("dX["+i+","+j+"]: " + as.scalar(dX[i,j])) > } > } > print("") > print("") > print("") > print("") > {code} > Output: > {code} > dX[1,1]: 1.5299997333070705 > dX[1,2]: 1.951679510186853 > dX[2,1]: 0.9372371721327426 > dX[2,2]: 0.11462997451231827 > dX[3,1]: 0.3913879515630596 > dX[3,2]: 0.4411374996556454 > dX[1,1]: 0.15757825641372136 > dX[1,2]: 1.6331143898957619 > dX[2,1]: 0.7271506546939133 > dX[2,2]: 0.648694276576909 > dX[3,1]: 1.4763697903577369 > dX[3,2]: 1.2645782773949483 > {code} > Notice that the outputs are different... magic! -- This message was sent by Atlassian JIRA (v6.3.4#6332)