-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DictionaryMatchingOp #509
base: main
Are you sure you want to change the base?
Conversation
📚 Documentation |
@rkcatarina : If you join this weeks hackathon, would you be interested to work on this? |
newy = newy.to(dtype=torch.complex64) | ||
newy = newy / torch.linalg.norm(newy, dim=0, keepdim=True) | ||
newy = newy.flatten(start_dim=1) | ||
newx = x[1] |
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.
Save all the x values, not only the second parameter
So self.x is a list of all the parameters:
Here: [M0,T1]
|
||
def append(self, *x: Unpack[Tin]) -> Self: | ||
(newy,) = self._f(*x) | ||
newy = newy.to(dtype=torch.complex64) |
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.
Keep the dtype of y
def forward(self, input_signal: torch.Tensor) -> tuple[Unpack[Tin]]: | ||
similar = einops.einsum(input_signal, self.y, 't ..., t idx -> idx ...') | ||
idx = torch.argmax(torch.abs(similar), dim=0) | ||
t1_start_neu = self.x[idx] |
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.
Return instead more than one parameter
x=tuple(xi[idx] for xi in self.x)
Return x
This already looks promising :) Why did you change from the list of x values (in the initial commit here) to only supporting a single T1? It would be great if the matching op can be used with multiple parameters (fingerprinting for example) |
… Change to double precision of dictionary matching without DictionaryMatchingOp
… Change to double precision of dictionary matching without DictionaryMatchingOp
Draft of dictionary matching function
Does only non-differentiable argmax matching, but good enough for now.
Needs tests, example, docstrings etc..
Related #465