Module Expr Str Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list NameLoad decorator_list Call NameLoad NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore ListLoad If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Assign NameStore ListLoad TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Num Assign NameStore ListLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Num Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword BinOpDiv NameLoad NameLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore BinOpDiv NameLoad NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Call NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad Assign NameStore ListLoad TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Num Assign NameStore ListLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Num Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad keyword NameLoad keyword ListLoad keyword ListLoad keyword AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Return Call NameLoad keyword NameLoad keyword ListLoad TupleLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword ListLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list NameLoad decorator_list Call NameLoad NameLoad
N/A N/A Evaluate Theano variables on auxiliary data and during training. N/A logging abc ABCMeta abstractmethod six add_metaclass theano tensor theano.ifelse ifelse blocks.utils shared_like N/A logger N/A N/A logging getLogger __name__ AggregationScheme N/A object N/A N/A How to incrementally evaluate a Theano variable over minibatches.

    An AggregationScheme allocates :class:`Aggregator` that can
    incrementally compute the value of a Theano variable on a full dataset
    by aggregating partial results computed on multiple batches.

    The AggregationScheme should be attached via the tag
    ``aggregation_scheme`` to a Theano variable which computes the desired
    value on a single batch.

    Parameters
    ----------
    variable: :class:`~tensor.TensorVariable`
        The variable that holds the desired value on a single batch.

     get_aggregator N/A N/A self N/A N/A N/A Return a new Aggregator for this variable. N/A N/A abstractmethod N/A N/A add_metaclass ABCMeta Aggregator N/A object N/A N/A An Aggregator incrementally evaluates a Theano variable on a dataset.

    .. warning::
        The Aggregators should never be created directly. Instead use the
        :meth:`AggregationScheme.get_aggregator` method.

    Example usages are:

    * compute the mean of some value over examples, sequence lengths etc.
    * track a parameter of a model
    * monitor a penalty

    The Aggregator maintains a set of Theano sharer values called
    accumulators and specifies how they should be initialized, and
    updated with incremental calculations. Finally, it
    provides a Theano variable that reads the accumulators
    and computes the final value.

    Parameters
    ----------
    aggregation_scheme : :class:`AggregationScheme`
        The aggregation scheme that constructed this Aggregator
    initialization_updates : list of Theano updates
        Updates that specify how to initialize shared variables of
        this Aggregator. *Can only refer to shared variables and
        constants.*
    accumulation_updates : list of Theano updates
        Updates that specify how a new batch of data gets processed
        by this Aggregator. *Can refer to model inputs.*
    readout_variable : :class:`~tensor.TensorVariable`
        Theano variable that holds the final value based on accumulated
        partial results. *readout_variable must only consist of shared
        variables and constants.*

    Attributes
    ----------
    All constructor parameters are accessible as attributes.

     __init__ N/A N/A self aggregation_scheme initialization_updates accumulation_updates readout_variable N/A None None None N/A N/A N/A self aggregation_scheme aggregation_scheme N/A N/A self readout_variable readout_variable N/A N/A initialization_updates None N/A N/A initialization_updates N/A N/A N/A accumulation_updates None N/A N/A accumulation_updates N/A N/A N/A self initialization_updates initialization_updates N/A N/A self accumulation_updates accumulation_updates N/A N/A Mean N/A AggregationScheme N/A N/A Aggregation scheme which computes the mean.

    Parameters
    ----------
    numerator : :class:`~tensor.TensorVariable`
        Theano variable for the numerator e.g. the likelihood
    denominator : :class:`~tensor.TensorVariable`
        Theano variable for the denominator e.g. the batch size

     __init__ N/A N/A self numerator denominator N/A N/A N/A N/A self numerator numerator N/A N/A self denominator denominator N/A get_aggregator N/A N/A self N/A N/A N/A initialized N/A shared_like 0.0 N/A numerator_acc N/A shared_like N/A self numerator N/A denominator_acc N/A shared_like N/A self denominator N/A numerator_zeros N/A N/A N/A N/A tensor as_tensor N/A self numerator zeros_like N/A denominator_zeros N/A N/A N/A N/A tensor as_tensor N/A self denominator zeros_like N/A conditional_update_num N/A N/A self numerator N/A ifelse initialized numerator_acc numerator_zeros N/A conditional_update_den N/A N/A self denominator N/A ifelse initialized denominator_acc denominator_zeros N/A initialization_updates N/A N/A numerator_acc N/A N/A tensor zeros_like numerator_acc N/A denominator_acc N/A N/A tensor zeros_like denominator_acc N/A initialized 0.0 N/A accumulation_updates N/A N/A numerator_acc conditional_update_num N/A denominator_acc conditional_update_den N/A initialized 1.0 N/A aggregator N/A Aggregator aggregation_scheme self initialization_updates initialization_updates accumulation_updates accumulation_updates readout_variable N/A numerator_acc denominator_acc N/A aggregator N/A N/A mean N/A N/A numerator denominator N/A 1.0 N/A N/A Mean of quantity (numerator) over a number (denominator) values. N/A variable N/A numerator denominator N/A N/A N/A variable tag aggregation_scheme N/A Mean numerator denominator N/A N/A variable name N/A numerator name N/A variable N/A Sum N/A AggregationScheme N/A N/A Aggregation scheme which computes the sum.

    Parameters
    ----------
    expression : :class:`~tensor.TensorVariable`
        Theano variable for the summand

     __init__ N/A N/A self expression N/A N/A N/A N/A self expression expression N/A get_aggregator N/A N/A self N/A N/A N/A initialized N/A shared_like 0.0 N/A expression_acc N/A shared_like N/A self expression N/A expression_zeros N/A N/A N/A N/A tensor as_tensor N/A self expression zeros_like N/A conditional_update_expr N/A N/A self expression N/A ifelse initialized expression_acc expression_zeros N/A initialization_updates N/A N/A expression_acc N/A N/A tensor zeros_like expression_acc N/A initialized 0.0 N/A accumulation_updates N/A N/A expression_acc conditional_update_expr N/A initialized 1.0 N/A aggregator N/A Aggregator aggregation_scheme self initialization_updates initialization_updates accumulation_updates accumulation_updates readout_variable expression_acc N/A aggregator N/A N/A sum_ N/A N/A expression N/A N/A N/A Sum of quantity (expression). N/A variable N/A N/A expression copy N/A N/A N/A variable tag aggregation_scheme N/A Sum expression N/A N/A variable name N/A expression name N/A variable N/A _DataIndependent N/A AggregationScheme N/A N/A Dummy aggregation scheme for values that don't depend on data. __init__ N/A N/A self variable N/A N/A N/A N/A self variable variable N/A get_aggregator N/A N/A self N/A N/A N/A N/A Aggregator aggregation_scheme self initialization_updates N/A accumulation_updates N/A readout_variable N/A self variable N/A N/A TakeLast N/A AggregationScheme N/A N/A Aggregation scheme which remembers only the last value. __init__ N/A N/A self variable N/A N/A N/A N/A self variable variable N/A get_aggregator N/A N/A self N/A N/A N/A N/A self storage N/A shared_like N/A self variable N/A N/A Aggregator aggregation_scheme self initialization_updates N/A N/A N/A self storage N/A N/A tensor zeros_like N/A self storage accumulation_updates N/A N/A N/A self storage N/A self variable readout_variable N/A self storage N/A N/A MonitoredQuantity N/A object N/A N/A The base class for monitored-quantities.

    To monitor a non-Theano quantity in Blocks you have to implement this
    interface for it. The initialize method initializes accumulators and
    the parameters needed to compute this quantity, accumulate method
    accumulates results for every batch, and finally readout is called
    to get the accumulated results.

    Attributes
    ----------
    requires : list
        List of Theano variables needed to calculate this quantity.
    name : str
        The name of monitored quantity which appears in the log.

    See Also
    --------
    :class:`~blocks.monitoring.evaluators.DatasetEvaluator`
    :class:`~blocks.extensions.DataStreamMonitoring`

     __init__ N/A N/A self requires name N/A None None N/A N/A N/A requires None N/A N/A requires N/A N/A N/A self requires requires N/A N/A self name name N/A initialize N/A N/A self N/A N/A N/A Initialize accumulators for this monitored quantity. N/A N/A abstractmethod accumulate N/A N/A self N/A N/A N/A Accumulate results for every batch. N/A N/A abstractmethod readout N/A N/A self N/A N/A N/A Readout the accumulated results to capture the final result. N/A N/A abstractmethod N/A N/A add_metaclass ABCMeta