SNAP Library 4.1, User Reference
2018-07-26 16:30:42
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
word2vec.h
Go to the documentation of this file.
1
#ifndef WORD_2_VEC_H
2
#define WORD_2_VEC_H
3
5
void
LearnEmbeddings
(
TVVec<TInt, int64>
& WalksVV,
const
int
& Dimensions,
6
const
int
& WinSize,
const
int
& Iter,
const
bool
& Verbose,
7
TIntFltVH
& EmbeddingsHV);
8
9
//Max x for e^x. Value taken from original word2vec code.
10
const
int
MaxExp
= 6;
11
12
//Size of e^x precomputed table.
13
const
int
ExpTablePrecision
= 10000;
14
const
int
TableSize
=
MaxExp
*
ExpTablePrecision
*2;
15
16
//Number of negative samples. Value taken from original word2vec code.
17
const
int
NegSamN
= 5;
18
19
//Learning rate for SGD. Value taken from original word2vec code.
20
const
double
StartAlpha
= 0.025;
21
22
#endif //WORD_2_VEC_H
LearnEmbeddings
void LearnEmbeddings(TVVec< TInt, int64 > &WalksVV, const int &Dimensions, const int &WinSize, const int &Iter, const bool &Verbose, TIntFltVH &EmbeddingsHV)
Learns embeddings using SGD, Skip-gram with negative sampling.
Definition:
word2vec.cpp:160
MaxExp
const int MaxExp
Definition:
word2vec.h:10
TVVec
Definition:
ds.h:2223
StartAlpha
const double StartAlpha
Definition:
word2vec.h:20
THash
Definition:
hash.h:97
ExpTablePrecision
const int ExpTablePrecision
Definition:
word2vec.h:13
TableSize
const int TableSize
Definition:
word2vec.h:14
NegSamN
const int NegSamN
Definition:
word2vec.h:17
snap-adv
word2vec.h
Generated on Thu Jul 26 2018 16:33:19 for SNAP Library 4.1, User Reference by
1.8.7