{"action":"created","issue":{"url":"https://api.github.com/repos/flashxio/FlashX/issues/372","repository_url":"https://api.github.com/repos/flashxio/FlashX","labels_url":"https://api.github.com/repos/flashxio/FlashX/issues/372/labels{/name}","comments_url":"https://api.github.com/repos/flashxio/FlashX/issues/372/comments","events_url":"https://api.github.com/repos/flashxio/FlashX/issues/372/events","html_url":"https://github.com/flashxio/FlashX/issues/372","id":216561530,"number":372,"title":"[FlashR]: spectral embedding on the page graph.","user":{"login":"zheng-da","id":70481,"avatar_url":"https://avatars2.githubusercontent.com/u/70481?v=3","gravatar_id":"","url":"https://api.github.com/users/zheng-da","html_url":"https://github.com/zheng-da","followers_url":"https://api.github.com/users/zheng-da/followers","following_url":"https://api.github.com/users/zheng-da/following{/other_user}","gists_url":"https://api.github.com/users/zheng-da/gists{/gist_id}","starred_url":"https://api.github.com/users/zheng-da/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zheng-da/subscriptions","organizations_url":"https://api.github.com/users/zheng-da/orgs","repos_url":"https://api.github.com/users/zheng-da/repos","events_url":"https://api.github.com/users/zheng-da/events{/privacy}","received_events_url":"https://api.github.com/users/zheng-da/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"zheng-da","id":70481,"avatar_url":"https://avatars2.githubusercontent.com/u/70481?v=3","gravatar_id":"","url":"https://api.github.com/users/zheng-da","html_url":"https://github.com/zheng-da","followers_url":"https://api.github.com/users/zheng-da/followers","following_url":"https://api.github.com/users/zheng-da/following{/other_user}","gists_url":"https://api.github.com/users/zheng-da/gists{/gist_id}","starred_url":"https://api.github.com/users/zheng-da/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zheng-da/subscriptions","organizations_url":"https://api.github.com/users/zheng-da/orgs","repos_url":"https://api.github.com/users/zheng-da/repos","events_url":"https://api.github.com/users/zheng-da/events{/privacy}","received_events_url":"https://api.github.com/users/zheng-da/received_events","type":"User","site_admin":false},"assignees":[{"login":"zheng-da","id":70481,"avatar_url":"https://avatars2.githubusercontent.com/u/70481?v=3","gravatar_id":"","url":"https://api.github.com/users/zheng-da","html_url":"https://github.com/zheng-da","followers_url":"https://api.github.com/users/zheng-da/followers","following_url":"https://api.github.com/users/zheng-da/following{/other_user}","gists_url":"https://api.github.com/users/zheng-da/gists{/gist_id}","starred_url":"https://api.github.com/users/zheng-da/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zheng-da/subscriptions","organizations_url":"https://api.github.com/users/zheng-da/orgs","repos_url":"https://api.github.com/users/zheng-da/repos","events_url":"https://api.github.com/users/zheng-da/events{/privacy}","received_events_url":"https://api.github.com/users/zheng-da/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-03-23T20:25:24Z","updated_at":"2017-04-07T15:11:51Z","closed_at":"2017-04-07T14:00:22Z","body":"Compute the first 8 eigenvectors on the augmented largest connected component of the page graph (A).\r\n```R\r\nlibrary(FlashGraphR)\r\nfg.set.conf(\"matrix/conf/run_test-EM.txt\")\r\nfg <- fg.get.graph(\"page-graph-compact\")\r\nspm <- fg.get.sparse.matrix(fg)\r\ndeg <- fg.degree(fg, mode=\"both\")/(2*fg.vcount(fg) - 1)\r\nmul <- function(x, extra) {\r\n\tx <- spm %*% x + fm.mapply.col(x, deg, \"*\")\r\n\tret <- t(spm) %*% x + fm.mapply.col(x, deg, \"*\")\r\n\tx <- NULL\r\n\tgc()\r\n\tret\r\n}\r\nres <- fm.eigen(mul, 8, n=nrow(spm), which=\"LM\", sym=TRUE)\r\n```\r\n\r\nThe 8 largest eigenvalues of B(A^TA) are\r\n```\r\n[1] 384367732 205767435 180147539 155830410 138021077 113701554 109839046\r\n[8]  95685877\r\n```\r\n\r\nso the corresponding singular values of A are\r\n```\r\n[1] 19605.299 14344.596 13421.905 12483.205 11748.237 10663.093 10480.413\r\n[8]  9781.916\r\n\r\n```\r\n\r\nEvaluate the precision of the right singular vectors.\r\n```R\r\nvecs <- fm.get.dense.matrix(\"pg-aug-right1to8.mat\")\r\nvecs <- fm.conv.store(vecs, in.mem=TRUE)\r\nvals <- c(384367732, 205767435, 180147539, 155830410, 138021077, 113701554, 109839046, 95685877)\r\nfm.cal.residul(mul, vals, vecs)\r\n```\r\n\r\nNow we can access its left and right singular vectors:\r\n```R\r\nright <- fm.get.dense.matrix(\"pg-aug-right1to8.mat\")\r\nright <- fm.conv.store(right, in.mem=TRUE)\r\nleft <- spm %*% right + fm.mapply.col(right, deg, \"*\")\r\nrescale <- function(x) {\r\n\tif (fm.is.vector(x))\r\n\t\tx <- fm.as.matrix(x)\r\n\tscal <- sqrt(colSums(x * x))\r\n\tx <- fm.mapply.row(x, scal, fm.bo.div)\r\n}\r\nleft <- rescale(left)\r\n```\r\n\r\nEvaluate the precision of the left singular vectors.\r\n```R\r\nmul <- function(x, extra) {\r\nx <- t(spm) %*% x + fm.mapply.col(x, deg, \"*\")\r\nret <- spm %*% x + fm.mapply.col(x, deg, \"*\")\r\nx <- NULL\r\ngc()\r\nret\r\n}\r\n\r\nvecs <- fm.get.dense.matrix(\"pg-aug-left1to8.mat\")\r\nvecs <- fm.conv.store(vecs, in.mem=TRUE)\r\nvals <- c(384367732, 205767435, 180147539, 155830410, 138021077, 113701554, 109839046, 95685877)\r\nfm.cal.residul(mul, vals, vecs)\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/flashxio/FlashX/issues/comments/292563849","html_url":"https://github.com/flashxio/FlashX/issues/372#issuecomment-292563849","issue_url":"https://api.github.com/repos/flashxio/FlashX/issues/372","id":292563849,"user":{"login":"zheng-da","id":70481,"avatar_url":"https://avatars2.githubusercontent.com/u/70481?v=3","gravatar_id":"","url":"https://api.github.com/users/zheng-da","html_url":"https://github.com/zheng-da","followers_url":"https://api.github.com/users/zheng-da/followers","following_url":"https://api.github.com/users/zheng-da/following{/other_user}","gists_url":"https://api.github.com/users/zheng-da/gists{/gist_id}","starred_url":"https://api.github.com/users/zheng-da/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zheng-da/subscriptions","organizations_url":"https://api.github.com/users/zheng-da/orgs","repos_url":"https://api.github.com/users/zheng-da/repos","events_url":"https://api.github.com/users/zheng-da/events{/privacy}","received_events_url":"https://api.github.com/users/zheng-da/received_events","type":"User","site_admin":false},"created_at":"2017-04-07T15:11:51Z","updated_at":"2017-04-07T15:11:51Z","body":"```R\r\nlibrary(FlashGraphR)\r\nfg.set.conf(\"matrix/conf/run_test-EM.txt\")\r\nfg <- fg.get.graph(\"page-graph-compact\")\r\nspm <- fg.get.sparse.matrix(fg)\r\ndeg <- fg.degree(fg, mode=\"both\")/(2*fg.vcount(fg) - 1)\r\nright <- fm.get.dense.matrix(\"pg-aug-right1to32.mat\")\r\nload(\"/mnt/nfs2/zhengda/pg-aug-32.vals\")\r\nprev.vals <- vals\r\nright1 <- fm.mapply.row(right, prev.vals, \"*\")\r\nmul <- function(x, extra) {\r\nexist <- right1 %*% (t(right) %*% x)\r\nx <- spm %*% x + fm.mapply.col(x, deg, \"*\")\r\nret <- t(spm) %*% x + fm.mapply.col(x, deg, \"*\")\r\nx <- NULL\r\ngc()\r\nret <- ret - exist\r\nret <- fm.conv.store(ret, in.mem=TRUE)\r\ngc()\r\nret\r\n}\r\nres <- fm.eigen(mul, 8, n=nrow(spm), which=\"LM\", sym=TRUE)\r\n\r\n```"}}
{"actor":{"display_login":"zheng-da"}}