Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
deepwalker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
deepwalker
Commits
e90294d4
Commit
e90294d4
authored
Apr 09, 2018
by
Jan Wijffels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs
parent
c5cd949e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
R/deepwalker_verse.R
+6
-5
man/deepwalker_verse.Rd
+5
-1
No files found.
R/deepwalker_verse.R
View file @
e90294d4
...
...
@@ -2,6 +2,7 @@
#' @description This function calculates node embeddings in a graph by using
#' VERSE (Versatile Graph Embeddings from Similarity Measures)
#' @param x an object of class dgRMatrix
#' @param similarity type of similarity. Currently defaults to pagerank.
#' @param dimension integer with the dimension of the embedding
#' @param epochs number of epochs
#' @param learning_rate the learning rate of the algorithm
...
...
@@ -25,7 +26,9 @@
#' x <- as_adj(karate)
#' x <- as(x, "RsparseMatrix")
#'
#' embeddings <- deepwalker_verse(x, dimension = 64, epochs = 1000)
#' node_embeddings <- deepwalker_verse(x, dimension = 64, epochs = 1000,
#' learning_rate = 0.0025, samples = 3, alpha = 0.85)
#' str(node_embeddings$embeddings)
deepwalker_verse
<-
function
(
x
,
similarity
=
c
(
"pagerank"
,
"adjacency"
,
"simrank"
),
dimension
=
128
,
...
...
@@ -43,10 +46,9 @@ deepwalker_verse <- function(x,
samples
=
samples
,
alpha
=
alpha
)
}
else
if
(
similarity
==
"adjacency"
){
.NotYetImplemented
()
}
else
if
(
similarity
==
"simrank"
){
.NotYetImplemented
()
}
emb
}
\ No newline at end of file
man/deepwalker_verse.Rd
View file @
e90294d4
...
...
@@ -11,6 +11,8 @@ deepwalker_verse(x, similarity = c("pagerank", "adjacency", "simrank"),
\arguments{
\item{x}{an object of class dgRMatrix}
\item{similarity}{type of similarity. Currently defaults to pagerank.}
\item{dimension}{integer with the dimension of the embedding}
\item{epochs}{number of epochs}
...
...
@@ -43,5 +45,7 @@ data(karate, package = "igraphdata")
x <- as_adj(karate)
x <- as(x, "RsparseMatrix")
embeddings <- deepwalker_verse(x, dimension = 64, epochs = 1000)
node_embeddings <- deepwalker_verse(x, dimension = 64, epochs = 1000,
learning_rate = 0.0025, samples = 3, alpha = 0.85)
str(node_embeddings$embeddings)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment