(g)
| 57 | |
| 58 | |
| 59 | def normalize_graph(g): |
| 60 | g = np.array(g) |
| 61 | g = g + g.T |
| 62 | g[g > 0.] = 1.0 |
| 63 | deg = g.sum(axis=1).reshape(-1) |
| 64 | deg[deg == 0.] = 1.0 |
| 65 | deg = np.diag(deg ** -0.5) |
| 66 | adj = np.dot(np.dot(deg, g), deg) |
| 67 | L = np.eye(g.shape[0]) - adj |
| 68 | return L |
| 69 | |
| 70 | |
| 71 | def eigen_decompositon(g): |
no outgoing calls
no test coverage detected