Class SparseMatrix
java.lang.Object
ai.beestream.jitnn.SparseMatrix
The structure of a sparse matrix (which entries are stored), built once on the host from
coordinate lists; the values are a separate tensor, in the order the coordinates were given,
so they can be learned. The structure is kept on the device in CSR form and, for the gradient
with respect to the dense operand, in CSR form of the transpose.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA structure with fixed values. -
Method Summary
Modifier and TypeMethodDescriptionintcols()The number of columns.static SparseMatrixfromCoo(int rows, int cols, int[] rowIndex, int[] colIndex) A rows x cols structure with entries at (rowIndex[e], colIndex[e]); duplicates add up.static SparseMatrix.Valuedgcn(int n, int[] src, int[] dst) The normalised adjacency of a graph convolutional network (Kipf and Welling, 2017), D^-1/2 (A + I) D^-1/2 for the directed edges src[e] -> dst[e] of an n-node graph (messages flow from source to destination, as in PyTorch Geometric's GCNConv).A dense with A's stored valuesvalues[nnz] (coordinate order); dense [cols, feat] gives [rows, feat].intnnz()The number of stored entries.introws()The number of rows.
-
Method Details
-
fromCoo
A rows x cols structure with entries at (rowIndex[e], colIndex[e]); duplicates add up. -
rows
public int rows()The number of rows. -
cols
public int cols()The number of columns. -
nnz
public int nnz()The number of stored entries. -
mm
-
gcn
The normalised adjacency of a graph convolutional network (Kipf and Welling, 2017), D^-1/2 (A + I) D^-1/2 for the directed edges src[e] -> dst[e] of an n-node graph (messages flow from source to destination, as in PyTorch Geometric's GCNConv).
-