EntityRegression

class graphstorm.model.EntityRegression(h_dim, dropout=0, out_dim=1, norm=None, use_bias=True)

Bases: GSLayer

Decoder for node regression tasks.

Parameters

h_dim: int

The input dimension size.

dropout: float

Dropout rate. Default: 0.

out_dim: int

The output dimension size. Default: 1 for regression tasks.

norm: str, optional

Normalization methods. Not used, but reserved for complex node regression implementation. Default: None.

use_bias: bool

Whether the node decoder uses a bias parameter. Default: True.

Changed in version 0.4.0: Add a new argument “use_bias” so users can control whether decoders have bias.

forward(inputs)

Node regression decoder forward computation.

Parameters

inputs: Tensor

The input embeddings.

Returns

out: Tensor of the prediction results.

predict(inputs)

Node regression prediction computation.

Parameters

inputs: Tensor

The input embeddings.

Returns

out: Tensor of the prediction results.

predict_proba(inputs)

For node regression task, it returns the same results as the predict() function.

Parameters

inputs: Tensor

The input embeddings.

Returns

out: Tensor of the prediction results.

property in_dims

Return the input dimension size, which is given in class initialization.

property out_dims

Return the output dimension size, which should be 1 for regression tasks.