lmp.util.infer#

Inference method utilities.

lmp.util.infer.create(infer_name: str, **kwargs: Any) BaseInfer[source]#

Create inference method instance by inference method’s name.

Inference method’s arguments are collected in **kwargs and are passed directly to inference method’s constructor.

Parameters
  • infer_name (str) – Name of the inference method to create.

  • kwargs (Any, optional) – Inference method’s parameters.

Returns

Inference method instance.

Return type

lmp.infer.BaseInfer

See also

lmp.infer

All available inference methods.

Examples

>>> from lmp.infer import TopKInfer
>>> import lmp.util.infer
>>> assert isinstance(lmp.util.infer.create(infer_name=TopKInfer.infer_name, k=5), TopKInfer)