public class GNNNodeData
extends java.lang.Object
node.getOrCreateInstance(GNNNodeData.class)
to either retrieve of create it.Constructor | Description |
---|---|
GNNNodeData() |
Modifier and Type | Method | Description |
---|---|---|
void |
addEmbeddingToHistory() |
|
void |
addRegularizationToHistory() |
|
void |
forceSetEmbedding(mklab.JGNN.core.Tensor embedding) |
Forcibly sets an embedding tensor.
|
mklab.JGNN.core.Tensor |
getEmbedding() |
Retrieves the embedding of the node.
|
java.util.LinkedList<mklab.JGNN.core.Tensor> |
getEmbeddingHistory() |
|
mklab.JGNN.core.Tensor |
getNeighborAggregation() |
An aggregation of the node's neighborhood embeddings in the social graph.
|
GNNNodeData |
setLearningRate(double learningRate) |
Sets the learning rate (default is 1) of the
updateEmbedding(Tensor) operation. |
void |
setNeighborAggregation(mklab.JGNN.core.Tensor neighborAggregation) |
Sets a neighbor aggregation that can be retrieved with
getNeighborAggregation() . |
void |
setRegularization(mklab.JGNN.core.Tensor regularization) |
Sets the regularization (default is a zero vector) of the
updateEmbedding(Tensor) operation. |
GNNNodeData |
setRegularizationWeight(double regularizationWeight) |
Sets the regularization weight (default is 0.1) of the
updateEmbedding(Tensor) operation. |
void |
updateEmbedding(mklab.JGNN.core.Tensor derivative) |
Performs the operation embedding += (embedding-regularization)*learningRate*regularizationWeight-derivative*learningRate
that is a regularized gradient descent over a computed derivative, where the area of regularization is constrained towards the point
set by
setRegularization(Tensor) . |
public void addEmbeddingToHistory()
public void addRegularizationToHistory()
public java.util.LinkedList<mklab.JGNN.core.Tensor> getEmbeddingHistory()
public mklab.JGNN.core.Tensor getEmbedding()
public void forceSetEmbedding(mklab.JGNN.core.Tensor embedding)
updateEmbedding(Tensor)
.embedding
- The embedding Tensorpublic void setNeighborAggregation(mklab.JGNN.core.Tensor neighborAggregation)
getNeighborAggregation()
. This
aggregation is computed by other devices and this function is called when receiving it as part
of the shared parameters. These operations are automatically performed by
GNNMiner.newInteractionParameters(eu.h2020.helios_social.core.contextualegonetwork.Interaction,
eu.h2020.helios_social.modules.socialgraphmining.SocialGraphMiner.SocialGraphMinerParameters,
eu.h2020.helios_social.modules.socialgraphmining.SocialGraphMiner.InteractionType)
neighborAggregation
- The received Tensor of neighbor aggregationpublic mklab.JGNN.core.Tensor getNeighborAggregation()
setNeighborAggregation(Tensor)
public void setRegularization(mklab.JGNN.core.Tensor regularization)
updateEmbedding(Tensor)
operation.
Setting this to a value other than a zero tensor helps influence the trained embedding to a latent space around
the given value. Hence, this can be used to influence the embeddings of nodes in the contextual ego network
given their embeddings in other devices.regularization
- The given regularization tensor.setRegularizationWeight(double)
public GNNNodeData setLearningRate(double learningRate)
updateEmbedding(Tensor)
operation.learningRate
- The given regularization weight.this
GNNNodeData instance.public GNNNodeData setRegularizationWeight(double regularizationWeight)
updateEmbedding(Tensor)
operation.
This helps influence the trained embedding to a latent space around the given valueregularizationWeight
- The given regularization weight.this
GNNNodeData instance.setRegularization(Tensor)
public void updateEmbedding(mklab.JGNN.core.Tensor derivative)
setRegularization(Tensor)
.derivative
- The derivative of the embedding.getEmbedding()
,
setLearningRate(double)
,
setRegularizationWeight(double)
,
setRegularization(Tensor)