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
ab8cc617
Commit
ab8cc617
authored
Apr 09, 2018
by
Jan Wijffels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up
parent
b670c13d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
src/verse.cpp
+16
-12
No files found.
src/verse.cpp
View file @
ab8cc617
...
...
@@ -205,8 +205,17 @@ void Train() {
// [[Rcpp::export]]
SEXP
deepwalker_verse
(
Rcpp
::
IntegerVector
dgrmatrix_p
,
Rcpp
::
IntegerVector
dgrmatrix_j
)
{
step
=
0
;
silent
=
false
;
n_threads
=
1
;
global_lr
=
0.0025
f
;
n_epochs
=
100000
;
n_hidden
=
128
;
n_samples
=
3
;
ppralpha
=
0.85
f
;
string
network_file
,
embedding_file
;
//
// Set random nr
//
ull
x
=
time
(
nullptr
);
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
ull
z
=
x
+=
UINT64_C
(
0x9E3779B97F4A7C15
);
...
...
@@ -216,16 +225,6 @@ SEXP deepwalker_verse(Rcpp::IntegerVector dgrmatrix_p, Rcpp::IntegerVector dgrma
}
init_sigmoid_table
();
silent
=
false
;
n_threads
=
1
;
global_lr
=
0.0025
f
;
n_epochs
=
100000
;
n_hidden
=
128
;
n_samples
=
3
;
ppralpha
=
0.85
f
;
embedding_file
=
"C:/Users/Jan/Dropbox/Work/RForgeBNOSAC/BNOSAC/deepwalker/inst/extdata/karate.emb"
;
//
// Create edges and offsets
//
...
...
@@ -239,6 +238,9 @@ SEXP deepwalker_verse(Rcpp::IntegerVector dgrmatrix_p, Rcpp::IntegerVector dgrma
for
(
int
i
=
0
;
i
<
(
int
)(
nv
+
1
);
i
++
)
offsets
[
i
]
=
dgrmatrix_p
[
i
];
//
// Compute embeddings
//
w0
=
static_cast
<
float
*>
(
aligned_malloc
(
nv
*
n_hidden
*
sizeof
(
float
),
DEFAULT_ALIGN
));
for
(
int
i
=
0
;
i
<
(
int
)(
nv
*
n_hidden
);
i
++
)
w0
[
i
]
=
drand
()
-
0.5
;
...
...
@@ -257,7 +259,9 @@ SEXP deepwalker_verse(Rcpp::IntegerVector dgrmatrix_p, Rcpp::IntegerVector dgrma
.
count
()
<<
" s to run"
<<
endl
;
/* Copy data and embeddings */
//
// Copy data and embeddings
//
Rcpp
::
IntegerVector
_edges
(
ne
);
Rcpp
::
IntegerVector
_offsets
(
nv
+
1
);
for
(
int
i
=
0
;
i
<
(
int
)
ne
;
i
++
)
...
...
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