Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created August 27, 2018 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/48531b04e6eba5098fb7c5bafa454af9 to your computer and use it in GitHub Desktop.
Save NMZivkovic/48531b04e6eba5098fb7c5bafa454af9 to your computer and use it in GitHub Desktop.
def map_input(self, input_vectors):
return_value = []
for vect in input_vectors:
min_index = min([i for i in range(len(self._weights_list))],
key=lambda x: np.linalg.norm(vect - self._weights_list[x]))
return_value.append(self._locations[min_index])
return return_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment