-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
Create kroncker_linear_operator.py
Merging Kronecker work to Equinox branch since it restructures class properties (would have to do this again otherwise).
Stage two: Abstract out more properties / methods as attributes to make it possible to build LinearOperators from defining a mat_mul, shape and dtype, *args, **kwargs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Before approving, I would ideally like to see two things:
- More documentation would be helpful. A simple notebook demonstrating the functionality of JaxLinOp and some more informative docstrings would be sufficient for now.
- Coverage - it looks like a report is being uploaded to codecov, but I don't see the percentage anywhere.
|
||
if not isinstance(size, int): | ||
raise ValueError(f"`length` must be an integer, but `length = {size}`.") | ||
if not isinstance(shape, tuple): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not want it be an Iterable
? I'd have thought a list was valid here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will open issue for this.
|
||
# TODO: Generalise to non-square matrices. | ||
# TODO: Generalise to non-square matrices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we either act on TODOs or open issues for them please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will open issue for these.
@@ -175,7 +178,8 @@ def from_dense(cls, dense: Float[Array, "N N"]) -> ZeroLinearOperator: | |||
""" | |||
|
|||
# TODO: check shapes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above re. TODOs
This moves the base class inheritance to
simple-pytree
.We move
shape
anddtype
to attributes of the dataclass, and ensure that dtype can be passed to each LinOps__init__
to override the dtype of the linear operator.