[SYSTEMDS-3332] Support for matrix-vector operations in ternary ifelse(X,B,v)#2559
Open
mike0609king wants to merge 10 commits into
Open
[SYSTEMDS-3332] Support for matrix-vector operations in ternary ifelse(X,B,v)#2559mike0609king wants to merge 10 commits into
mike0609king wants to merge 10 commits into
Conversation
Adapt the R tests to work with column and row vectors (internally those are matrices).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces broadcasting ifelse as well as optimizations for certain cases. The broadcasting is done such that the resulting values are the maximum rows and columns of the inputs.
The following optimizations have been implemented
Measurements. In the following benchmarks a row size of 2111 and column size of 300 have been used. Note that multiple tests are run for each optimization (around 30 for each); the median value is displayed to be more robust to outliers.
**.functions.ternary.FullIfElseTest#testScalar***.functions.ternary.FullIfElseTest#testRow***.functions.ternary.FullIfElseTest#testCol***.functions.ternary.FullIfElseTestwith and without optimizationsColumn optimization case. Running larger matrices for all tests took extremely long. This is why I only did this for the column case, which deserved to be scrutinized more. The
testColMatrixMatrixDenseCPtest with a row size of 4111 and column size of 3000 was executed out with and without optimization the optimized version ran in 0.838s and the one without optimization required 1.547s. Other seeds for the matrix yielded similar results.Additional comments
1e-10otherwise there are errors with the matrix comparisons. This issue seems to be present in other tests such as theFullTransposeTestas well. Maybe some exact values get lost while matrices are stored in files due to compression.