foam_graph.transforms package

Submodules

foam_graph.transforms.keep_only_main_attrs module

class foam_graph.transforms.keep_only_main_attrs.KeepOnlyMainAttrs(attrs=('x', 'edge_index', 'edge_attr', 'y', 'pos'))

Bases: object

Removes all attributes except the desired ones.

Parameters

attr (list) – List of attributes to keep.

foam_graph.transforms.make2D module

class foam_graph.transforms.make2D.Make2D(plane)

Bases: object

Scales an attribute to a given range.

Parameters
  • attr (str) – The attribute to stack.

  • fields (list of lists or list of str) – Fields and components to stack.

plane_to_comps = {'xy': (0, 1), 'xz': (0, 3), 'yz': (2, 3)}

foam_graph.transforms.normalizeZScore module

class foam_graph.transforms.normalizeZScore.NormalizeZScore(attr='x', attr_mean=0, attr_std=1)

Bases: object

Scales an attribute to a given mean and std.

Parameters
  • attr (str, optional) – The attribute to scale. (default: x)

  • attr_mean (float or Tensor, optional) – Mean values. (default: 0)

  • attr_std (float or Tensor, optional) – Std. dev. values. (default: 1)

unscale(data)

foam_graph.transforms.scale module

class foam_graph.transforms.scale.Scale(attr='x', attr_min=0, attr_max=1)

Bases: object

Scales an attribute to a given range.

Parameters
  • attr (str, optional) – The attribute to scale. (default: x)

  • attr_min (float or Tensor, optional) – Minimum values. (default: 0)

  • attr_max (float or Tensor, optional) – Maximum values. (default: 1)

unscale(data)

foam_graph.transforms.stack module

class foam_graph.transforms.stack.Stack(attr, fields)

Bases: object

Creates an attribute by stacking other attributes.

Parameters
  • attr (str) – The attribute to stack.

  • fields (list of lists or list of str) – Fields and components to stack.

unstack(data)

Module contents

class foam_graph.transforms.ApplyLambdaTemporalSignal(attr: str, func: Callable[[Iterable[torch_geometric.data.data.Data]], torch.Tensor], n_past: int = 0, n_future: int = 0)

Bases: object

class foam_graph.transforms.KeepOnlyMainAttrs(attrs=('x', 'edge_index', 'edge_attr', 'y', 'pos'))

Bases: object

Removes all attributes except the desired ones.

Parameters

attr (list) – List of attributes to keep.

class foam_graph.transforms.Make2D(plane)

Bases: object

Scales an attribute to a given range.

Parameters
  • attr (str) – The attribute to stack.

  • fields (list of lists or list of str) – Fields and components to stack.

plane_to_comps = {'xy': (0, 1), 'xz': (0, 3), 'yz': (2, 3)}
class foam_graph.transforms.NormalizeZScore(attr='x', attr_mean=0, attr_std=1)

Bases: object

Scales an attribute to a given mean and std.

Parameters
  • attr (str, optional) – The attribute to scale. (default: x)

  • attr_mean (float or Tensor, optional) – Mean values. (default: 0)

  • attr_std (float or Tensor, optional) – Std. dev. values. (default: 1)

unscale(data)
class foam_graph.transforms.Scale(attr='x', attr_min=0, attr_max=1)

Bases: object

Scales an attribute to a given range.

Parameters
  • attr (str, optional) – The attribute to scale. (default: x)

  • attr_min (float or Tensor, optional) – Minimum values. (default: 0)

  • attr_max (float or Tensor, optional) – Maximum values. (default: 1)

unscale(data)
class foam_graph.transforms.Stack(attr, fields)

Bases: object

Creates an attribute by stacking other attributes.

Parameters
  • attr (str) – The attribute to stack.

  • fields (list of lists or list of str) – Fields and components to stack.

unstack(data)