Skip to content

Instantly share code, notes, and snippets.

@goog
Created September 14, 2012 14:54
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 goog/3722398 to your computer and use it in GitHub Desktop.
Save goog/3722398 to your computer and use it in GitHub Desktop.
from numpy import *
def pagerank(d,v_quadratic_error):
M= array([[0,0,0,0,1],
[0.5,0,0,0,0],
[0.5,0,0,0,0],
[0,1,0.5,0,0],
[0,0,0.5,1,0]])
N=M.shape[1]
v=random.rand(N,1)
v=v/linalg.norm(v)
a=array([[inf]])
last_v = dot(ones(N,1),a)
print v
pagerank(0,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment