public class GraphVectorsImpl<V,E> extends java.lang.Object implements GraphVectors<V,E>
| Modifier and Type | Field and Description |
|---|---|
protected IGraph<V,E> |
graph |
protected GraphVectorLookupTable |
lookupTable |
| Constructor and Description |
|---|
GraphVectorsImpl() |
| Modifier and Type | Method and Description |
|---|---|
IGraph<V,E> |
getGraph() |
int |
getVectorSize() |
org.nd4j.linalg.api.ndarray.INDArray |
getVertexVector(int vertexIdx) |
org.nd4j.linalg.api.ndarray.INDArray |
getVertexVector(Vertex<V> vertex) |
int |
numVertices() |
double |
similarity(int vertexIdx1,
int vertexIdx2)
Returns the cosine similarity of the vector representations of two vertices in the graph,
given the indices of these verticies
|
double |
similarity(Vertex<V> vertex1,
Vertex<V> vertex2)
Returns the cosine similarity of the vector representations of two vertices in the graph
|
int[] |
verticesNearest(int vertexIdx,
int top) |
protected GraphVectorLookupTable lookupTable
public int numVertices()
numVertices in interface GraphVectors<V,E>public int getVectorSize()
getVectorSize in interface GraphVectors<V,E>public org.nd4j.linalg.api.ndarray.INDArray getVertexVector(Vertex<V> vertex)
getVertexVector in interface GraphVectors<V,E>public org.nd4j.linalg.api.ndarray.INDArray getVertexVector(int vertexIdx)
getVertexVector in interface GraphVectors<V,E>public int[] verticesNearest(int vertexIdx,
int top)
verticesNearest in interface GraphVectors<V,E>public double similarity(Vertex<V> vertex1, Vertex<V> vertex2)
similarity in interface GraphVectors<V,E>public double similarity(int vertexIdx1,
int vertexIdx2)
similarity in interface GraphVectors<V,E>