EdgeRegression
- class graphstorm.model.EdgeRegression(h_dim, target_etype, out_dim=1, dropout=0, norm=None, use_bias=True)
Bases:
GSEdgeDecoderDecoder for edge regression tasks.
Can be used for edge regression tasks or edge feature reconstruction.
New in version 0.4.0: The
EdgeRegression.Parameters
- h_dim: int
The input dimension size.
- target_etype: tuple of str
The target etype for prediction in the format of (src_ntype, etype, dst_ntype).
- out_dim: int
The output dimension size. Default: 1.
- dropout: float
Dropout rate. Default: 0.
- norm: str, optional
Normalization methods. Not used, but reserved for complex edge regression. implementation. Default: None.
- use_bias: bool
Whether the edge decoder uses a bias parameter. Default: True.
- forward(g, h, e_h=None)
MLP-based edge decoder forward computation.
Parameters
- g: DGLGraph
The graph of target edges.
- h: dict of Tensor
The input node embeddings in the format of {ntype: emb}.
- e_h: dict of Tensor
The input edge embeddings in the format of {(src_ntype, etype, dst_ntype): emb}. Not used, but reserved for future support of edge embeddings. Default: None.
Returns
- out: Tensor
The prediction results.
- predict(g, h, e_h=None)
MLP-based edge regression prediction computation.
Parameters
- g: DGLGraph
The graph of target edges.
- h: dict of Tensor
The input node embeddings in the format of {ntype: emb}.
- e_h: dict of Tensor
The input edge embeddings in the format of {(src_ntype, etype, dst_ntype): emb}. Not used, but reserved for future support of edge embeddings. Default: None.
Returns
- out: Tensor
The prediction results.
- predict_proba(g, h, e_h=None)
MLP-based edge regression prediction computation. It returns the same results as the
predict()function.Parameters
- g: DGLGraph
The graph of target edges.
- h: dict of Tensor
The input node embeddings in the format of {ntype: emb}.
- e_h: dict of Tensor
The input edge embeddings in the format of {(src_ntype, etype, dst_ntype): emb}. Not used, but reserved for future support of edge embeddings. Default: None.
Returns
- out: Tensor
The prediction results. Same as calling predict function.
- property in_dims
Return the input dimension size, which is given in class initialization.
- property out_dims
Return the output dimension size.