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

Gpushift dev #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Gpushift dev #1

wants to merge 11 commits into from

Conversation

boykovdn
Copy link

  • Basic clustering step
  • sklearn-like interface

Copy link
Owner

@imagirom imagirom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR Boyko! I've added some minor comments, it would be great if you could have a look before merging :)


def predict(self, X):
r"""
Predict cluster belonging based on which cluster center is the closest.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

belonging -> assignment

# spherical = self._get_distance_metric('spherical')
#
# composite = lambda x,y : euclidean(x,y)**2 + spherical(x,y)
#
Copy link
Owner

@imagirom imagirom Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this block is no longer needed (as you have implemented it differently above), I would prefer to delete it. Same for the other commented blocks above.


self.cluster_centers_ = None

self.meanshift_step = MeanShiftStep(bandwidth=bandwidth, kernel=kernel, use_keops=use_keops)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it your intention to not pass the distance metric here? I thought not only the final clustering but also every MS step should use the chosen metric.

Comment on lines +25 to +27
:param distance_metric: callable or None
If None, uses standard Euclidean distances. For special applications,
the passing of a custom distance function is allowed.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to add the required signature of distance metric if it is a callable, including the shapes of the input tensors, to the docstring.

@imagirom
Copy link
Owner

imagirom commented Feb 17, 2021

Reminder to also add an example using the new interface (I will do that)

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

Successfully merging this pull request may close these issues.

2 participants