Module ImportFrom alias Import alias Import alias Import alias Import alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Pass FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Return BoolOpOr Call NameLoad NameLoad Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore GeneratorExp TupleLoad NameLoad IfExp BoolOpAnd Call NameLoad NameLoad CompareEq AttributeLoad NameLoad attr Num Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr TupleLoad Num Index Num NameLoad comprehension TupleStore NameStore NameStore NameLoad Assign NameStore GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad UnaryOpNot Call NameLoad NameLoad Assign NameStore GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad CompareNotIn NameLoad TupleLoad Str Str Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad Return NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad If CompareNotEq NameLoad Num body AugAssignAdd NameStore Num Return ListComp Call NameLoad BinOpMult NameLoad NameLoad BinOpMult BinOpAdd NameLoad Num NameLoad comprehension NameStore Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad If NameLoad body Expr Yield Call AttributeLoad NameLoad attr NameLoad orelse While NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Yield SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assert CompareGt NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num While NameLoad body While CompareLtE BinOpAdd NameLoad NameLoad NameLoad body Expr Yield SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad AugAssignAdd NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore BinOpSub NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore SubscriptLoad NameLoad Slice Num NameLoad Expr Yield NameLoad Assign NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Expr Str Assign NameStore Dict Str Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore BinOpSub NameLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore BinOpBitAnd NameLoad NameLoad Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad TryExcept body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListComp IfExp Call NameLoad NameLoad NameLoad TupleLoad NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Assign NameStore Num Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad AugAssignAdd NameStore NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults AttributeLoad NameLoad attr body Expr Str Assign NameStore ListComp IfExp Call NameLoad NameLoad NameLoad TupleLoad NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore Call NameLoad Call NameLoad NameLoad NameLoad orelse Assign TupleStore NameStore NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad If NameLoad body AugAssignAdd NameStore Num Assign NameStore GeneratorExp Call NameLoad BinOpMult NameLoad NameLoad BinOpMult BinOpAdd NameLoad Num NameLoad comprehension NameStore Call NameLoad NameLoad If CompareEq NameLoad Num body Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad orelse If CompareEq NameLoad Num body Assign NameStore ListComp SubscriptLoad NameLoad ExtSlice Slice Index NameLoad comprehension NameStore NameLoad orelse If CompareEq NameLoad Num body Assign NameStore ListComp SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore ListComp Call NameLoad NameLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad If CompareGt Call NameLoad NameLoad Num body If Call NameLoad GeneratorExp CompareNotEq Call NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index Num comprehension NameStore SubscriptLoad NameLoad Slice Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr While NameLoad body Assign NameStore ListComp NameLoad comprehension TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Index Num While NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Yield Call NameLoad GeneratorExp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad NameLoad If BoolOpAnd NameLoad CompareGtE NameLoad NameLoad body Raise Call NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore SubscriptLoad Call NameLoad Call NameLoad NameLoad keyword Num Index Num Return TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A __future__ absolute_import N/A inspect N/A itertools N/A random N/A warnings N/A numpy np gd GradientDescent bfgs Lbfgs cg NonlinearConjugateGradient rprop Rprop rmsprop RmsProp adadelta Adadelta adam Adam N/A N/A sklearn.grid_search ParameterSampler N/A N/A N/A ImportError N/A N/A is_garray N/A N/A cand N/A N/A N/A N/A hasattr cand as_numpy_array N/A is_array N/A N/A cand N/A N/A N/A N/A N/A is_garray cand N/A isinstance cand N/A np ndarray N/A clear_info N/A N/A info N/A N/A N/A Clean up contents of info dictionary for better use.

    Keys to be removed are ``args``, ``kwargs`` and any non-scalar numpy or
    gnumpy arrays. Numpy scalars are converted to floats.

    Examples
    --------

    >>> import numpy as np
    >>> info = {'args': None, 'foo': np.zeros(3), 'bar': np.array(1),
    ...         'loss': 1.}
    >>> cleared = clear_info(info)
    >>> cleared == {'bar': 1.0, 'loss': 1.0}
    True
     N/A items N/A N/A info iteritems N/A items N/A N/A k N/A N/A N/A is_array v N/A N/A v size 1 N/A float N/A N/A N/A v reshape N/A 1 N/A 0 v N/A N/A k v items N/A items N/A N/A k v N/A N/A k v items N/A N/A is_array v N/A items N/A N/A k v N/A N/A k v items N/A k N/A args kwargs N/A N/A dict items N/A coroutine N/A N/A f N/A N/A N/A Turn a generator function into a coroutine by calling .next() once. started N/A N/A N/A args kwargs N/A N/A cr N/A f args kwargs N/A N/A next cr N/A cr N/A N/A started N/A aslist N/A N/A item N/A N/A N/A N/A N/A isinstance item N/A list tuple N/A N/A item N/A item N/A item N/A mini_slices N/A N/A n_samples batch_size N/A N/A N/A Yield slices of size `batch_size` that work with a container of length
    `n_samples`. N/A N/A n_batches rest N/A divmod n_samples batch_size N/A N/A rest 0 N/A N/A n_batches 1 N/A N/A N/A slice N/A i batch_size N/A N/A i 1 batch_size N/A i N/A range n_batches N/A draw_mini_slices N/A N/A n_samples batch_size with_replacement N/A False N/A N/A slices N/A mini_slices n_samples batch_size N/A idxs N/A range N/A len slices N/A with_replacement N/A N/A N/A N/A N/A random choice slices N/A N/A True N/A N/A N/A N/A random shuffle idxs N/A i idxs N/A N/A N/A N/A slices N/A i N/A draw_mini_indices N/A N/A n_samples batch_size N/A N/A N/A N/A n_samples batch_size N/A idxs N/A range n_samples N/A N/A N/A random shuffle idxs N/A pos 0 N/A True N/A N/A N/A N/A pos batch_size n_samples N/A N/A N/A N/A idxs N/A pos N/A pos batch_size N/A pos batch_size N/A batch N/A idxs N/A pos N/A needed N/A batch_size N/A len batch N/A N/A N/A random shuffle idxs N/A batch N/A idxs N/A 0 needed N/A N/A batch N/A pos needed N/A optimizer N/A N/A identifier wrt N/A args kwargs N/A N/A Return an optimizer with the desired configuration.

    This is a convenience function if one wants to try out different optimizers
    but wants to change as little code as possible.

    Additional arguments and keyword arguments will be passed to the constructor
    of the class. If the found class does not take the arguments supplied, this
    will `not` throw an error, but pass silently.

    :param identifier: String identifying the optimizer to use. Can be either
        ``asgd``, ``gd``, ``lbfgs``, ``ncg``, ``rprop``, ``adadelta`` or
        ``smd``.
    :param wrt: Numpy array pointing to the data to optimize.
     N/A klass_map N/A gd lbfgs ncg rprop rmsprop adadelta adam GradientDescent Lbfgs NonlinearConjugateGradient Rprop RmsProp Adadelta Adam N/A klass N/A klass_map N/A identifier N/A argspec N/A N/A inspect getargspec N/A klass __init__ N/A N/A N/A argspec keywords None N/A N/A expected_keys N/A set N/A argspec args N/A given_keys N/A set N/A N/A kwargs keys N/A unused_keys N/A given_keys expected_keys N/A i unused_keys N/A N/A N/A N/A warnings warn N/A Argument named %s is not expected by %s N/A i klass N/A used_keys N/A expected_keys given_keys N/A kwargs N/A dict N/A N/A k N/A kwargs N/A k N/A k used_keys N/A N/A N/A opt N/A klass wrt args kwargs N/A N/A N/A TypeError N/A N/A N/A TypeError N/A required arguments for %s: %s N/A klass N/A argspec args N/A opt N/A shaped_from_flat N/A N/A flat shapes N/A N/A N/A Given a one dimensional array ``flat``, return a list of views of shapes
    ``shapes`` on that array.

    Each view will point to a distinct memory region, consecutively allocated
    in flat.

    Parameters
    ----------

    flat : array_like
        Array of one dimension.

    shapes : list of tuples of ints
        Each entry of this list specifies the shape of the corresponding view
        into ``flat``.

    Returns
    -------

    views : list of arrays
        Each entry has the shape given in ``shapes`` and points as a view into
        ``flat``.
     N/A shapes N/A N/A N/A isinstance i int N/A i i N/A i shapes N/A sizes N/A N/A N/A np prod i N/A i shapes N/A n_used 0 N/A views N/A N/A N/A size shape N/A zip sizes shapes N/A N/A this N/A flat N/A n_used N/A n_used size N/A n_used size N/A N/A this shape shape N/A N/A N/A views append this N/A views N/A empty_with_views N/A N/A shapes empty_func N/A N/A np empty N/A N/A Create an array and views shaped according to ``shapes``.

    The ``shapes`` parameter is a list of tuples of ints.  Each tuple
    represents a desired shape for an array which will be allocated in a bigger
    memory region. This memory region will be represented by an array as well.

    For example, the shape speciciation ``[2, (3, 2)]`` will create an array
    ``flat`` of size 8. The first view will have a size of ``(2,)`` and point
    to the first two entries, i.e. ``flat`[:2]`, while the second array will
    have a shape of ``(3, 2)`` and point to the elements ``flat[2:8]``.


    Parameters
    ----------

    spec : list of tuples of ints
        Specification of the desired shapes.

    empty_func : callable
        function that returns a memory region given an integer of the desired
        size. (Examples include ``numpy.empty``, which is the default,
        ``gnumpy.empty`` and ``theano.tensor.empty``.


    Returns
    -------

    flat : array_like (depending on ``empty_func``)
        Memory region containing all the views.

    views : list of array_like
        Variable number of results. Each contains a view into the array
        ``flat``.


    Examples
    --------

    >>> from climin.util import empty_with_views
    >>> flat, (w, b) = empty_with_views([(3, 2), 2])
    >>> w[...] = 1
    >>> b[...] = 2
    >>> flat
    array([ 1.,  1.,  1.,  1.,  1.,  1.,  2.,  2.])
    >>> flat[0] = 3
    >>> w
    array([[ 3.,  1.],
           [ 1.,  1.],
           [ 1.,  1.]])

     N/A shapes N/A N/A N/A isinstance i int N/A i i N/A i shapes N/A sizes N/A N/A N/A np prod i N/A i shapes N/A n_pars N/A sum sizes N/A flat N/A empty_func n_pars N/A views N/A shaped_from_flat flat shapes N/A N/A flat views N/A minibatches N/A N/A arr batch_size d N/A 0 N/A N/A Return a list of views of the given arr.

    Each view represents a mini bach of the data.

    Parameters
    ----------

    arr : array_like
        Array to obtain batches from. Needs to be slicable. If ``d > 0``, needs
        to have a ``.shape`` attribute from which the number of samples can
        be obtained.

    batch_size : int
        Size of a batch. Last batch might be smaller if ``batch_size`` is not a
        divisor of ``arr``.

    d : int, optional, default: 0
        Dimension along which the data samples are separated and thus slicing
        should be done.

    Returns
    -------

    mini_batches : list
        Each item of the list is a view of ``arr``. Views are ordered.
     N/A N/A d 0 N/A N/A N/A n_batches rest N/A divmod N/A len arr batch_size N/A N/A N/A n_batches rest N/A divmod N/A N/A arr shape N/A d batch_size N/A rest N/A N/A n_batches 1 N/A slices N/A N/A slice N/A i batch_size N/A N/A i 1 batch_size N/A i N/A range n_batches N/A N/A d 0 N/A N/A res N/A N/A arr N/A i N/A i slices N/A N/A N/A d 1 N/A N/A res N/A N/A arr N/A N/A N/A i N/A i slices N/A N/A N/A d 2 N/A N/A res N/A N/A arr N/A N/A N/A N/A i N/A i slices N/A res N/A iter_minibatches N/A N/A lst batch_size dims n_cycles random_state N/A False None N/A N/A Return an iterator that successively yields tuples containing aligned
    minibatches of size `batch_size` from slicable objects given in `lst`, in
    random order without replacement.

    Because different containers might require slicing over different
    dimensions, the dimension of each container has to be givens as a list
    `dims`.


    Parameters
    ----------

    lst : list of array_like
        Each item of the list will be sliced into mini batches in alignemnt with
        the others.

    batch_size : int
        Size of each batch. Last batch might be smaller.

    dims : list
        Aligned with ``lst``, gives the dimension along which the data samples
        are separated.

    n_cycles : int or False, optional [default: False]
        Number of cycles after which to stop the iterator. If ``False``, will
        yield forever.

    random_state : a numpy.random.RandomState object, optional [default : None]
        Random number generator that will act as a seed for the minibatch order


    Returns
    -------

    batches : iterator
        Infinite iterator of mini batches in random order (without
        replacement).
     N/A batches N/A N/A minibatches i batch_size d N/A N/A i d N/A zip lst dims N/A N/A N/A len batches 1 N/A N/A N/A any N/A N/A N/A len i N/A len N/A batches N/A 0 N/A i N/A batches N/A 1 N/A N/A N/A ValueError containers to be batched have different lengths N/A counter N/A N/A itertools count N/A N/A random_state None N/A N/A N/A N/A random seed N/A N/A random_state normal N/A True N/A N/A indices N/A i N/A N/A i _ N/A enumerate N/A batches N/A 0 N/A True N/A N/A N/A N/A random shuffle indices N/A i indices N/A N/A N/A N/A tuple N/A N/A b N/A i N/A b batches N/A count N/A next counter N/A N/A n_cycles N/A count n_cycles N/A N/A N/A StopIteration N/A OptimizerDistribution N/A object N/A N/A OptimizerDistribution class.

    Can be used for specifying optimizers in scikit-learn's randomized parameter
    search.

    Attributes
    ----------

    options : dict
        Maps an optimizer key to a grid to sample from.
     __init__ N/A N/A self N/A options N/A N/A Create an OptimizerDistribution object.

        Parameters
        ----------

        options : dict
            Maps an optimizer key to a grid to sample from.
         N/A N/A self options options N/A rvs N/A N/A self N/A N/A N/A opt N/A N/A random choice N/A list N/A N/A N/A self options keys N/A grid N/A N/A self options N/A opt N/A sample N/A N/A list N/A ParameterSampler grid n_iter 1 N/A 0 N/A N/A opt sample N/A N/A