Skip to content

Gpushift dev - #1

Open
boykovdn wants to merge 11 commits into
imagirom:masterfrom
boykovdn:gpushift-dev
Open

Gpushift dev#1
boykovdn wants to merge 11 commits into
imagirom:masterfrom
boykovdn:gpushift-dev

Conversation

@boykovdn

Copy link
Copy Markdown
  • Basic clustering step
  • sklearn-like interface

@imagirom imagirom left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
Owner

Choose a reason for hiding this comment

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

belonging -> assignment

Comment thread gpushift/sklearn/meanshift.py Outdated
# spherical = self._get_distance_metric('spherical')
#
# composite = lambda x,y : euclidean(x,y)**2 + spherical(x,y)
#

@imagirom imagirom Feb 17, 2021

Copy link
Copy Markdown
Owner

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.

Comment thread gpushift/sklearn/meanshift.py Outdated

self.cluster_centers_ = None

self.meanshift_step = MeanShiftStep(bandwidth=bandwidth, kernel=kernel, use_keops=use_keops)

Copy link
Copy Markdown
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 thread gpushift/meanshift.py
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
Copy Markdown
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

imagirom commented Feb 17, 2021

Copy link
Copy Markdown
Owner

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