Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

dev: Custom matmul, and LinOp ops constructer. #23

Open
daniel-dodd opened this issue Mar 16, 2023 · 0 comments
Open

dev: Custom matmul, and LinOp ops constructer. #23

daniel-dodd opened this issue Mar 16, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@daniel-dodd
Copy link
Member

The idea is to have things like matmuls (and other opts) as dataclass attributes:

@dataclass
class LinearOperator(...):
    ...
    matmul: Callable[[LinearOperator, Float[Array, "N M"]] Float[Array, "N M"]] = static_field(...)

    def __matmul__(self, other :  Float[Array, "N M"]) -> Float[Array, "N M"]
          return matmul(self, other)

So that the user, can, create a LinearOperator from defining a matmul for conjugate gradients (akin to distrax's Lambda Bijector):

MyLinOp = LinearOperator(..., matmul=*)

This is clean to do from the recent refactoring of #20.

@daniel-dodd daniel-dodd added enhancement New feature or request good first issue Good for newcomers labels Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant