-
Notifications
You must be signed in to change notification settings - Fork 24
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
Implement non-binary Sparse Block Codes #153
Comments
Hi, new to torchhd but would be really interested in contributing. Is this problem still open? As I understand is it related to implementing the data structure to hold vectors as sparse arrays and then implementing MAP operations for sparse vector data structures @mikeheddes? |
Hi, thank you for your interest in Torchhd. Yes, this feature has yet to be added to the library and as far as I'm aware no one is working on it yet. One aspect that is a bit unique about this model is that we have to decide wether to use I think it is worth trying both ways and perhaps giving users an option to convert between them if it is indeed the case that one is more efficient than the other in different settings. A good start for you before starting the implementation into Torchhd as a new Here are some example PRs to help you get started:
If you have any questions don't hesitate to ask. |
Sounds like an interesting problem! I'll have a go. Could it be useful to add conversions to non binary sparse array conversions either way? |
Hi @mikeheddes, So I've been having a bit of a think about this and my thoughts for implementation are we could go down two routes with how to sparsify the arrays of hypervectors:
For the MAP operations this should be easy enough with torch.sparse, however permutation is slightly annoying as torch.sparse doesn't let you modify indices inplace, so we'd have to recreate the sparse array object each time, if we used this. I need to do some benchmarks on circular convolution but I guess the big O would just be dependent on how much compression we get, would probably need to implement some thinning to compress more |
Apologies for the delayed response. I think these are two good options for the implementation. I find the second one quite clever. One downside is that PyTorch doesn't support run-length encoding right now (as far as I know) which means that we will have to implement all the operations ourselves whereas for the COO format many operations are supported already. I would not worry about having to create a new sparse array for every operation, I believe it is PyTorch's default to create a new tensor for every operation. As for the thinning operations, I think we should provide this as a separate method on the inherited |
A follow up feature to the support of Binary Sparse Block Codes. See discussion in #146.
The text was updated successfully, but these errors were encountered: