public class DeepWalk<V,E> extends GraphVectorsImpl<V,E>
Modifier and Type | Class and Description |
---|---|
static class |
DeepWalk.Builder<V,E> |
Modifier and Type | Field and Description |
---|---|
static int |
STATUS_UPDATE_FREQUENCY |
graph, lookupTable
Constructor and Description |
---|
DeepWalk() |
Modifier and Type | Method and Description |
---|---|
void |
fit(GraphWalkIterator<V> iterator)
Fit the DeepWalk model using a single thread using a given GraphWalkIterator.
|
void |
fit(GraphWalkIteratorProvider<V> iteratorProvider)
Fit the model, in parallel, using a given GraphWalkIteratorProvider.
This object is used to generate multiple GraphWalkIterators, which can then be distributed to each thread to do in parallel Note that fit(IGraph, int) will be more convenient in many casesNote that initialize(IGraph) or initialize(int[]) must be called first. |
void |
fit(IGraph<V,E> graph,
int walkLength)
Fit the model, in parallel.
|
double |
getLearningRate() |
int |
getVectorSize() |
int |
getWindowSize() |
void |
initialize(IGraph<V,E> graph)
Initialize the DeepWalk model with a given graph.
|
void |
initialize(int[] graphVertexDegrees)
Initialize the DeepWalk model with a list of vertex degrees for a graph.
Specifically, graphVertexDegrees[i] represents the vertex degree of the ith vertex vertex degrees are used to construct a binary (Huffman) tree, which is in turn used in the hierarchical softmax implementation |
GraphVectorLookupTable |
lookupTable() |
void |
setLearningRate(double learningRate) |
getGraph, getVertexVector, getVertexVector, numVertices, similarity, similarity, verticesNearest
public static final int STATUS_UPDATE_FREQUENCY
public int getVectorSize()
getVectorSize
in interface GraphVectors<V,E>
getVectorSize
in class GraphVectorsImpl<V,E>
public int getWindowSize()
public double getLearningRate()
public void setLearningRate(double learningRate)
public void initialize(IGraph<V,E> graph)
public void initialize(int[] graphVertexDegrees)
graphVertexDegrees
- degrees of each vertexpublic void fit(IGraph<V,E> graph, int walkLength)
graph
- Graph to fitwalkLength
- Length of rangom walks to generatepublic void fit(GraphWalkIteratorProvider<V> iteratorProvider)
fit(IGraph, int)
will be more convenient in many casesinitialize(IGraph)
or initialize(int[])
must be called first.iteratorProvider
- GraphWalkIteratorProviderfit(IGraph, int)
public void fit(GraphWalkIterator<V> iterator)
fit(IGraph, int)
or fit(GraphWalkIteratorProvider)
should be used.initialize(IGraph)
or initialize(int[])
must be called first.iterator
- iterator for graph walkspublic GraphVectorLookupTable lookupTable()