Skip to content

Instantly share code, notes, and snippets.

View shirish93's full-sized avatar

Shirish Pokharel shirish93

  • Liberty Liberty Leee-bertyyy
  • Boston, MA
View GitHub Profile
@shirish93
shirish93 / vector_rejection_in_python.py
Last active January 13, 2017 23:19
Vector Rejection in Python
import numpy as np
from gensim import matutils
def normalize(v):
'''normalize' a vector, in the traditional linear algebra sense.'''
norm=np.linalg.norm(v)
if norm==0:
return v
return v/norm
def reject(A,B):