nip.factory._ParameterSelector#

class nip.factory._ParameterSelector[source]#

A data structure for storing and retrieving classes based on parameter values.

Methods Summary

__init__()

add(cls[, filter])

Add a class to the parameter selector.

select(hyper_params)

Get a class from the parameter selector based on the parameters.

Attributes

filter_matchers

Methods

__init__()[source]#
add(cls: type, filter: dict[str, str] = {})[source]#

Add a class to the parameter selector.

Parameters:
  • cls (type) – The class to store.

  • filter (dict[str, str], default={}) – The set of addresses and values to match the parameter value. filter[address] = value means that the parameter value at address must be value. All must match for the class to be retrieved. An empty dictionary will always match.

select(hyper_params: HyperParameters) type[source]#

Get a class from the parameter selector based on the parameters.

Parameters:

hyper_params (HyperParameters) – The parameters of the experiment.

Returns:

cls (type) – The class that matches the parameters.