in utils/shape_utils.py [0:0]
def compute_neigh_hessian(self):
neigh = self.get_neigh()
n_vert = self.get_vert().shape[0]
H = sparse.lil_matrix(1e-3 * sparse.identity(n_vert))
I = np.array(neigh[:, 0].detach().cpu())
J = np.array(neigh[:, 1].detach().cpu())
V = np.ones([neigh.shape[0]])
U = -V
H = H + sparse.lil_matrix(
sparse.coo_matrix((U, (I, J)), shape=(n_vert, n_vert))
)
H = H + sparse.lil_matrix(
sparse.coo_matrix((U, (J, I)), shape=(n_vert, n_vert))
)
H = H + sparse.lil_matrix(
sparse.coo_matrix((V, (I, I)), shape=(n_vert, n_vert))
)
H = H + sparse.lil_matrix(
sparse.coo_matrix((V, (J, J)), shape=(n_vert, n_vert))
)
self.neigh_hessian = H