asmushetzel opened a new pull request #14501: added extraction/generation of 
diagonal/triangonal matrices to linalg
URL: https://github.com/apache/incubator-mxnet/pull/14501
 
 
   
   ## Description ##
   This add operators to the linalg namespace to 
   - extract a diagonal from a single or a batch of square matrices
   - construct a single or a batch of square diagonal matrices
   - extract a triangle from a single or a batch of square matrices
   - construct a single or a batch of square triangular matrices
   
   This operators are useful for various tasks when working with linear 
algebra. We have a specific use case already where batches of triangular 
matrices exist and the non-zero entries above/below some diagonal must be 
rearranged as 1-d tensors. 
   
   There are various variants of such diagonal/triangular matrix manipulation 
in numpy (tril/triu/diag/diagonal/diagflat) and also one already in MXNet 
(diag-operator). Unfortunately without real consistency. MXNet's current  diag 
operator is consistent with numpy's diag. So it lacks any notion of batches of 
matrices which is a fundamental concept for all linalg-operators.
   
   It doesn't seem to be useful to write the "one fits all" operator for all 
types of manipulation of diagonal/triangular matrix operations. So this PR 
rather provides a consistent mechanism that can be used in the context of 
"linalg"-namespace and supports the usual operations that people need when they 
do advanced linear algebra. In particular, it does support the same level of 
batched matrix support, the same data types, diagonal and triangular matrices 
and enough flexibility to deal also with diagonal/triangular matrices that are 
defined by other than the main diagonal.
    
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ X] Changes are complete (i.e. I finished coding on this PR)
   - [ X] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [ X] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [X ] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to