Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions keras_hrp/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from typing import List


@numba.jit
@numba.jit(nopython=False)
def hammingsim_two(v1: List[bool], v2: List[bool], sz: int) -> float:
""" Matching coefficient """
return (v1 == v2).sum() / sz


@numba.jit
@numba.jit(nopython=False)
def hammingsim_matrix(x: List[List[bool]]) -> List[List[float]]:
""" Matching coefficient between two boolean vectors as matrix """
n, sz = x.shape
Expand All @@ -23,7 +23,7 @@ def hammingsim_matrix(x: List[List[bool]]) -> List[List[float]]:
return s


@numba.jit
@numba.jit(nopython=False)
def hammingsim_list(x: List[List[bool]]) -> List[float]:
""" Matching coefficient between two boolean vectors as list """
n, sz = x.shape
Expand Down