Skip to content

Add norm-p as distance metric (with positive real p)#160

Merged
xgdgsc merged 3 commits intopeterwittek:masterfrom
tomcucinotta:norm-p
Jun 14, 2021
Merged

Add norm-p as distance metric (with positive real p)#160
xgdgsc merged 3 commits intopeterwittek:masterfrom
tomcucinotta:norm-p

Conversation

@tomcucinotta
Copy link
Copy Markdown

This patch adds the option to provide as vect_distance strings like "norm-3", "norm-6", "norm-2" (same as the default) and "norm-inf", besides "euclidean" when creating the SOM (norm-p with any positive real p). For example:

som = somoclu.Somoclu(n_columns, n_rows, compactsupport=False, vect_distance="norm-6")

This is supported with kerneltype = 0 only, at the moment (the GPU kernel uses an optimized implementation tied to p=2, but in the future it might be possible to add in denseGpuKernels.cu, alongside the current implementation, an alternate one if norm-p is specified).

…norm in the input vector space, with arbitrary positive real p, or norm-inf

norm-p is currently supported only with kerneltype=0, so initialization fails with error if norm-p is required with a different kerneltype
@xgdgsc xgdgsc merged commit 4e46705 into peterwittek:master Jun 14, 2021
@xgdgsc
Copy link
Copy Markdown
Collaborator

xgdgsc commented Jun 14, 2021

Thamks!

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