RemoveTrainingClasses
¶
Bases: BaseTransform
Removes classes from the node-level training set given by
train_mask, e.g. to build a zero-shot setting, as PyG's
RemoveTrainingClasses.
The nodes whose node_labels is one of classes are set to False
in train_mask. Other masks are unchanged.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
classes
|
Sequence[int]
|
The classes to remove from the training set. |
required |
Example:
graph = GraphData(
edge_index=mx.array([[0, 1], [1, 2]]),
node_labels=mx.array([0, 1, 2]),
train_mask=mx.array([True, True, True]),
)
graph = RemoveTrainingClasses([1])(graph)
graph.train_mask
# mx.array([True, False, True])
Methods:
| Name | Description |
|---|---|
process |
Removes the classes from the training mask of |
Source code in mlx_graphs/transforms/labels.py
process
¶
Removes the classes from the training mask of data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
GraphData
|
The graph to transform. It must have |
required |
Returns:
| Type | Description |
|---|---|
GraphData
|
The graph with the updated |
Source code in mlx_graphs/transforms/labels.py
from mlx_graphs.transforms import RemoveTrainingClasses · mlx_graphs/transforms/labels.py