scatter_var
¶
Computes the (population) variance of the values grouped by index
(along axis 0),
\(\mathrm{var}(\mathcal{X}) = \mathrm{mean}(\mathcal{X}^2) -
\mathrm{mean}(\mathcal{X})^2\), as PyG's VarAggregation. Groups without
any value are set to 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
array
|
Input array of shape |
required |
index
|
array
|
Array of shape |
required |
out_size
|
int
|
Number of groups. |
required |
semi_grad
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
array
|
An array of shape |
Source code in mlx_graphs/utils/scatter.py
from mlx_graphs.utils.scatter import scatter_var · mlx_graphs/utils/scatter.py