Created
September 14, 2012 14:54
-
-
Save goog/3722398 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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