Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
EmbeddingBag
#2031Add
EmbeddingBag
#2031Changes from 20 commits
eccd097
c437e2e
cbf8836
fbc9e4c
f2e7e9d
5373a41
7be2fd0
baf5d15
1db1c42
a962695
fdd1bb6
5bca3b0
6c04ecd
89db5f5
4aa753e
091fe71
a98c7a2
fcefac3
ba64701
5bc01f5
6878df8
fae30da
24dd98a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This seems to be too general of a type restriction. For example, I could define a
MultiHot <: AbstractVector{Bool}
, that succinctly encodes a bag with fixedk
elements (in fact, this was one of my original use cases forEmbeddingBags
), and then if indexi
is true, it should be included in the bag.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.
This is a possible encoding. Dispatch on such a type specifically is not forbidden by this method.
So far, I think every other use of one-hot arrays behaves identically if you
collect
it. This is why I think it makes sense to define these methods forAbstractArray{Bool}
. Another boolean type with a different meaning cannot also have this property thatcollect
doesn't change the result.