Skip to content
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

Feature request: segment_argmax #13460

Open
RanBenIzhak opened this issue Oct 3, 2017 · 8 comments
Open

Feature request: segment_argmax #13460

RanBenIzhak opened this issue Oct 3, 2017 · 8 comments

Comments

@RanBenIzhak
Copy link

Currently trying to return argmax from a tensor for selected slices (segments)
slices do not have the same length, so reshaping can't be used.
was looking for a function similar to tf.segment_max, only with indices as the return value.

for e.g
a = [1, 2, 3, 4, 5, 6]
seg = [0, 0, 0, 1, 1, 2]
tf.segment_argmax return value will be
[2, 4, 5]

@tatatodd tatatodd added the stat:contribution welcome Status - Contributions welcome label Oct 10, 2017
@tatatodd
Copy link
Contributor

Contributions are welcome!

@srhrshr
Copy link

srhrshr commented Oct 12, 2017

I can try to implement this.

Per the example by OP, the segments are [1,2,3], [4,5], [6] and the segment_argmax function returns the indices of max element in each segment, but with a reference to the unsegmented list.

Is my understanding correct ?

@RanBenIzhak
Copy link
Author

yes,
indices will be with reference to the unsegmented list.

my intention was to use these indices to slice the original tensor for all the max tensors

@michaelzqj
Copy link
Contributor

I will go to work on this.

@damro
Copy link

damro commented Feb 29, 2020

Any update on this? I would also extend the feature request to support unsorted_segment_argmax, segment_argmax, unsorted_segment_argmin, and segment_argmin.

@patnaa2
Copy link

patnaa2 commented Nov 16, 2020

Would also like to throw my vote on this as a feature ; this would be super useful.

@github-actions
Copy link

This issue is stale because it has been open for 180 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Mar 28, 2023
@damro
Copy link

damro commented May 17, 2023

How is this progressing?

@github-actions github-actions bot removed stale This label marks the issue/pr stale - to be closed automatically if no activity stat:contribution welcome Status - Contributions welcome labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants