clipppy.commands.command¶
Module Contents¶
- class clipppy.commands.command.Command(**kwargs)¶
An abstract base class for commands.
Defines an interface that allows manipulating parameters of the command in three distinct ways. Firstly, the class object itself provides the defaults. Next, when an instance is created, the constructor takes arbitrary keyword arguments that will be set as instance attributes overriding the defaults. Finally, when a class instance is called, any possible parameters that are included in the :python:
**kwargsparameter are extracted and set on the instance before execution of theforwardmethod, which should be overridden to provide the actual command implementation.Commands also support “binding” keyword parameters in much the same way as
functools.partial, through theboundkwargsproperty. The provided keywords are then always included in theforwardcall, if the forward call has explicit parameters with the same names.- boundkwargs :dict¶
A dictionary of values to be forwarded to each call of
forward, if there are exact name matches in its signature.
- no_call¶
Special value to be used to indicate that instead of calling an object, it should be returned as is.
- plate_stack :Union[Iterable[int], ContextManager]¶
A stack of plates or an iterable of ints.
Either one or multiple plates (as returned by
pyro.plateorpyro.plate_stack) or an iterable of ints that will be converted to a stack of plates (namedplate_0, etc. and aligned torightmost_dim = -1) for batch mock generation.
- __call__(self, *args, **kwargs)¶
- __getattribute__(self, name)¶
Return getattr(self, name).
- abstract forward(self, *args, **kwargs)¶
- property plate(self) pyro.plate¶
- class clipppy.commands.command.SamplingCommand(**kwargs)¶
An abstract base class for commands.
Defines an interface that allows manipulating parameters of the command in three distinct ways. Firstly, the class object itself provides the defaults. Next, when an instance is created, the constructor takes arbitrary keyword arguments that will be set as instance attributes overriding the defaults. Finally, when a class instance is called, any possible parameters that are included in the :python:
**kwargsparameter are extracted and set on the instance before execution of theforwardmethod, which should be overridden to provide the actual command implementation.Commands also support “binding” keyword parameters in much the same way as
functools.partial, through theboundkwargsproperty. The provided keywords are then always included in theforwardcall, if the forward call has explicit parameters with the same names.- conditioning :bool = False¶
Whether to retain any conditioning already applied to the model. If a false value,
pyro.poutine.handlers.unconditionwill be applied tomodelbefore evaluating.
- initting :bool = True¶
Whether to respect
initvalues in config sites.
- property init(self)¶
- property uncondition(self)¶