Implement a prototypical 2-layer Ω distance
This commit is contained in:
parent
391473adf3
commit
3a5a2bb473
@ -73,6 +73,16 @@ def omega_distance(x, y, omega):
|
|||||||
return distances
|
return distances
|
||||||
|
|
||||||
|
|
||||||
|
def ML_omega_distance(x, y, omega_0, omega_1, mask_0, mask_1):
|
||||||
|
"""Multi-Layer Omega distance."""
|
||||||
|
x, y = (arr.view(arr.size(0), -1) for arr in (x, y))
|
||||||
|
omega = (omega_0 * mask_0) @ (omega_1 * mask_1)
|
||||||
|
projected_x = x @ omega
|
||||||
|
projected_y = y @ omega
|
||||||
|
distances = squared_euclidean_distance(projected_x, projected_y)
|
||||||
|
return distances
|
||||||
|
|
||||||
|
|
||||||
def lomega_distance(x, y, omegas):
|
def lomega_distance(x, y, omegas):
|
||||||
r"""Localized Omega distance.
|
r"""Localized Omega distance.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user