Module Expr Str Import alias Import alias identifier Import alias Import alias identifier TryExcept body Assign NameStore NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If UnaryOpNot Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr Dict orelse Assign SubscriptStore AttributeLoad NameLoad attr Index Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad NameLoad Str TupleLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Return Call SubscriptLoad AttributeLoad NameLoad attr Index Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareIn Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num Num Num Num NameLoad body Expr Str If BoolOpOr CompareIs NameLoad NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore BinOpAdd NameLoad BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareGtGt Num NameLoad Num body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr keyword Num keyword BinOpSub Num NameLoad keyword TupleLoad NameLoad NameLoad attr NameLoad AugAssignBitOr SubscriptStore NameLoad ExtSlice Slice NameLoad Slice NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr NameLoad AugAssignMult NameStore NameLoad If CompareGt NameLoad Num body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr BinOpDiv BinOpMult NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index Num NameLoad If CompareNotEq NameLoad Num body Assign NameStore BinOpMult NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad ExtSlice Slice NameLoad Slice NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num NameLoad body Expr Str If BoolOpOr CompareIs NameLoad NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad BinOpAdd NameLoad BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore TupleLoad NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Yield TupleLoad NameLoad NameLoad Break decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore TupleLoad NameLoad For NameStore NameLoad body For NameStore AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Yield TupleLoad NameLoad NameLoad Break decorator_list
N/A N/A Utility functions and classes. N/A fnmatch N/A numpy np N/A theano N/A theano.tensor TT N/A N/A N/A basestring basestring N/A N/A N/A NameError N/A N/A basestring str N/A FLOAT N/A N/A theano config floatX N/A FLOAT_CONTAINERS N/A N/A TT scalar N/A TT vector N/A TT matrix N/A TT tensor3 N/A TT tensor4 N/A INT_CONTAINERS N/A N/A TT iscalar N/A TT ivector N/A TT imatrix N/A TT itensor3 N/A TT itensor4 Error N/A Exception N/A N/A N/A ConfigurationError N/A Error N/A N/A N/A Registrar N/A type N/A N/A A metaclass that builds a registry of its subclasses. __init__ N/A N/A cls name bases dct N/A N/A N/A N/A N/A hasattr cls _registry N/A N/A N/A cls _registry N/A N/A N/A N/A N/A cls _registry N/A N/A N/A name lower cls N/A name N/A getattr cls __extra_registration_keys__ N/A N/A N/A N/A N/A cls _registry N/A N/A N/A name lower cls N/A N/A N/A N/A super Registrar cls __init__ name bases dct N/A build N/A N/A cls key N/A args kwargs N/A N/A N/A N/A N/A cls _registry N/A N/A N/A key lower args kwargs N/A get_class N/A N/A cls key N/A N/A N/A N/A N/A cls _registry N/A N/A N/A key lower N/A is_registered N/A N/A cls key N/A N/A N/A N/A N/A N/A key lower N/A cls _registry N/A N/A random_matrix N/A N/A rows cols mean std sparsity radius diagonal rng N/A 0 1 0 0 0 None N/A N/A Create a matrix of randomly-initialized weights.

    Parameters
    ----------
    rows : int
        Number of rows of the weight matrix -- equivalently, the number of
        "input" units that the weight matrix connects.
    cols : int
        Number of columns of the weight matrix -- equivalently, the number
        of "output" units that the weight matrix connects.
    mean : float, optional
        Draw initial weight values from a normal with this mean. Defaults to 0.
    std : float, optional
        Draw initial weight values from a normal with this standard deviation.
        Defaults to 1.
    sparsity : float in (0, 1), optional
        If given, ensure that the given fraction of the weight matrix is
        set to zero. Defaults to 0, meaning all weights are nonzero.
    radius : float, optional
        If given, rescale the initial weights to have this spectral radius.
        No scaling is performed by default.
    diagonal : float, optional
        If nonzero, create a matrix containing all zeros except for this value
        along the diagonal. If nonzero, other arguments (except for rows and
        cols) will be ignored.
    rng : :class:`numpy.random.RandomState` or int, optional
        A random number generator, or an integer seed for a random number
        generator. If not provided, the random number generator will be created
        with an automatically chosen seed.

    Returns
    -------
    matrix : numpy array
        An array containing random values. These often represent the weights
        connecting each "input" unit to each "output" unit in a layer.
     N/A N/A N/A rng None N/A isinstance rng int N/A N/A rng N/A N/A N/A np random RandomState rng N/A arr N/A mean N/A std N/A N/A rng randn rows cols N/A N/A 1 sparsity 0 N/A N/A k N/A min rows cols N/A mask N/A N/A N/A N/A rng binomial n 1 p N/A 1 sparsity size N/A rows cols astype bool N/A N/A mask N/A N/A k N/A k N/A N/A N/A N/A np eye k astype bool N/A arr mask N/A N/A radius 0 N/A N/A N/A u s vT N/A N/A N/A np linalg svd arr full_matrices False N/A arr N/A N/A np dot N/A N/A np dot u N/A N/A np diag N/A N/A radius s N/A abs N/A s N/A 0 vT N/A N/A diagonal 0 N/A N/A arr N/A diagonal N/A N/A N/A np eye N/A max rows cols N/A N/A rows N/A cols N/A N/A N/A arr astype FLOAT N/A random_vector N/A N/A size mean std rng N/A 0 1 None N/A N/A Create a vector of randomly-initialized values.

    Parameters
    ----------
    size : int
        Length of vecctor to create.
    mean : float, optional
        Mean value for initial vector values. Defaults to 0.
    std : float, optional
        Standard deviation for initial vector values. Defaults to 1.
    rng : :class:`numpy.random.RandomState` or int, optional
        A random number generator, or an integer seed for a random number
        generator. If not provided, the random number generator will be created
        with an automatically chosen seed.

    Returns
    -------
    vector : numpy array
        An array containing random values. This often represents the bias for a
        layer of computation units.
     N/A N/A N/A rng None N/A isinstance rng int N/A N/A rng N/A N/A N/A np random RandomState rng N/A N/A N/A N/A mean N/A std N/A N/A rng randn size astype FLOAT N/A outputs_matching N/A N/A outputs patterns N/A N/A N/A Get the outputs from a network that match a pattern.

    Parameters
    ----------
    outputs : dict or sequence of (str, theano expression)
        Output expressions to filter for matches. If this is a dictionary, its
        ``items()`` will be processed for matches.
    patterns : sequence of str
        A sequence of glob-style patterns to match against. Any parameter
        matching any pattern in this sequence will be included in the match.

    Yields
    ------
    matches : pair of str, theano expression
        Generates a sequence of (name, expression) pairs. The name is the name
        of the output that matched, and the expression is the symbolic output in
        the network graph.
     N/A N/A isinstance patterns basestring N/A N/A patterns N/A patterns N/A N/A isinstance outputs dict N/A N/A outputs N/A N/A outputs items N/A N/A name expr outputs N/A N/A pattern patterns N/A N/A N/A N/A fnmatch fnmatch name pattern N/A N/A N/A N/A name expr N/A N/A params_matching N/A N/A layers patterns N/A N/A N/A Get the parameters from a network that match a pattern.

    Parameters
    ----------
    layers : list of :class:`theanets.layers.Layer`
        A list of network layers to retrieve parameters from.
    patterns : sequence of str
        A sequence of glob-style patterns to match against. Any parameter
        matching any pattern in this sequence will be included in the match.

    Yields
    ------
    matches : pair of str, theano expression
        Generates a sequence of (name, expression) pairs. The name is the name
        of the parameter that matched, and the expression represents the
        parameter symbolically.
     N/A N/A isinstance patterns basestring N/A N/A patterns N/A patterns N/A layer layers N/A N/A param N/A layer params N/A N/A name N/A param name N/A pattern patterns N/A N/A N/A N/A fnmatch fnmatch name pattern N/A N/A N/A N/A name param N/A N/A