aeppl.scan.MeasurableScan.__init__#

MeasurableScan.__init__(inputs, outputs, info, mode=None, typeConstructor=None, truncate_gradient=-1, name=None, as_while=False, profile=None, allow_gc=True, strict=True)#
Parameters
  • inputs (List[Variable]) –

    Inputs of the inner function of Scan. These take the following general form:

    sequences + mit-mot-inputs + mit-sot-inputs + sit-sot-inputs + shared-inputs + non-sequences

    where each term is a list of Variables.

  • outputs (List[Variable]) –

    Outputs of the inner function of Scan. These take the following general form:

    mit-mot-outputs + mit-sot-outputs + sit-sot-outputs + nit-sots + shared-outputs [+ while-condition]

    where each term is a list of Variables.

  • info (ScanInfo) – A collection of information about the sequences and taps.

  • mode (Optional[Mode]) – The mode used to compile the inner-graph. If you prefer the computations of one step of scan to be done differently then the entire function, you can use this parameter to describe how the computations in this loop are done (see aesara.function for details about possible values and their meaning).

  • typeConstructor (Optional[Callable[[List[bool], Union[str, generic]], TensorType]]) – Function that constructs a TensorType for the outputs.

  • truncate_gradient (int) – truncate_gradient is the number of steps to use in truncated back-propagation through time (BPTT). If you compute gradients through a Scan Op, they are computed using BPTT. By providing a different value then -1, you choose to use truncated BPTT instead of classical BPTT, where you go for only truncate_gradient number of steps back in time.

  • name (Optional[str]) – When profiling scan, it is helpful to provide a name for any instance of scan. For example, the profiler will produce an overall profile of your code as well as profiles for the computation of one step of each instance of Scan. The name of the instance appears in those profiles and can greatly help to disambiguate information.

  • profile (Union[str, bool, None]) – If True or a non-empty string, a profile object will be created and attached to the inner graph of Scan. When profile is True, the profiler results will use the name of the Scan instance, otherwise it will use the passed string. The profiler only collects and prints information when running the inner graph with the CVM Linker.

  • allow_gc (bool) –

    Set the value of allow_gc for the internal graph of the Scan. If set to None, this will use the value of aesara.config.scan__allow_gc.

    The full Scan behavior related to allocation is determined by this value and the flag aesara.config.allow_gc. If the flag allow_gc is True (default) and this allow_gc is False (default), then we let Scan allocate all intermediate memory on the first iteration, and they are not garbage collected after that first iteration; this is determined by allow_gc. This can speed up allocation of the subsequent iterations. All those temporary allocations are freed at the end of all iterations; this is what the flag aesara.config.allow_gc means.

  • strict (bool) – If True, all the shared variables used in the inner-graph must be provided.

  • as_while (bool) –