Higher Rank Features

class vanguard.features.HigherRankFeatures(rank, **kwargs)[source]

Bases: Decorator

Make a GPController compatible with higher rank features.

GPyTorch assumes that input features are rank-1 (vectors) and a variety of RuntimeErrors are thrown from different places in the code if this is not true. This decorator modifies the gp model class to make it compatible with higher rank features.

Warning

This decorator is EXPERIMENTAL. It may cause errors or give incorrect results, and may have breaking changes without warning.

Example:
>>> @HigherRankFeatures(2)
... class NewController(GPController):
...     pass
Parameters:
__init__(rank, **kwargs)[source]
Parameters:
  • rank (int) – The rank of the input features. Should be a positive integer.

  • kwargs (Any)

property safe_updates: dict[type, set[str]]

Get a dictionary (class -> set[names]) of overrides/new methods that we consider “safe”.

verify_decorated_class(cls)[source]

Verify that a class can be decorated by this instance.

Parameters:

cls (type[Any]) – The class to be decorated.

Raises:
Return type:

None