-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make nbl.smat.LookupNdBuilder more generic #97
Comments
Happy to pick this up if you don't have the bandwidth at the moment, @clbarnes. At first glance, the only problem appears to be that def _get_pairs(self):
matching_pairs = list(set(self._yield_matching_pairs()))
# need to know the eventual distdot count
# so we know how many non-matching pairs to draw
q_idx_count = Counter(p[0] for p in matching_pairs)
n_matching_qual_vals = sum(
len(self.dotprops[q_idx]) * n_reps for q_idx, n_reps in q_idx_count.items()
)
nonmatching_pairs = self._pick_nonmatching_pairs(n_matching_qual_vals)
return matching_pairs, nonmatching_pairs If I understand this correctly, you're using it to match the number of points (i.e. size) rather than the number of neurons between matching and non-matching pairs? Currently only I can see three solutions:
I'd favour option 3. Thoughts? |
@swilson27 I pushed some changed to the |
At present it's annotated to take Dotprops and functions which operate on Dotprops. Synblast doesn't use Dotprops but would benefit from a LookupNdBuilder, and I don't think the builder actually uses any dotprops functionality as it just uses the passed-in function to operate on them. Any object with length N and any function which takes 2 of those objects to produce an array of length N should work, so this may just be a case of adding a generic type annotation.
Requested by @swilson27
The text was updated successfully, but these errors were encountered: