Module Import alias identifier Import alias Import alias Import alias Import alias identifier Import alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad CompareLt NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Return SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpSub NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return UnaryOpUSub Call AttributeLoad NameLoad attr BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assert BoolOpAnd CompareEq AttributeLoad NameLoad attr Num CompareEq AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad If Call AttributeLoad NameLoad attr NameLoad Num body If CompareGt Call AttributeLoad NameLoad attr NameLoad Num body Return Num orelse Return Num If CompareGt Call NameLoad BinOpSub Num BinOpDiv Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad BinOpAdd NameLoad Num Num body Import alias Expr Call AttributeLoad NameLoad attr Return BinOpSub Num BinOpDiv Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad BinOpAdd NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assert CompareEq AttributeLoad NameLoad attr Num Return Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Index Num decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpDiv BinOpMult NameLoad SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num Assign NameStore BinOpDiv BinOpSub BinOpAdd BinOpMult NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num Return Call NameLoad ListLoad TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Num ListLoad Num UnaryOpUSub NameLoad SubscriptLoad NameLoad Slice Num keyword Num Slice Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr BinOpMult NameLoad BinOpPow NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults vararg kwarg body Expr Str TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Num NameLoad Assign NameStore Num For NameStore Call AttributeLoad NameLoad attr BinOpSub Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpSub SubscriptLoad NameLoad Index BinOpAdd NameLoad Num NameLoad Assign NameStore BinOpDiv NameLoad Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd NameLoad BinOpMult NameLoad NameLoad BinOpAdd NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd NameLoad BinOpMult NameLoad NameLoad BinOpAdd NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd NameLoad BinOpMult NameLoad NameLoad BinOpAdd NameLoad NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index BinOpAdd NameLoad Num BinOpAdd NameLoad BinOpMult BinOpDiv NameLoad Num BinOpAdd BinOpAdd BinOpAdd NameLoad BinOpMult Num NameLoad BinOpMult Num NameLoad NameLoad Return NameLoad decorator_list
N/A N/A numpy np N/A scipy N/A scipy.signal N/A theano.tensor.nnet N/A theano.tensor TT N/A theano.tensor.extra_ops collections OrderedDict weighted_sample N/A N/A weights objects N/A N/A N/A 
    Return a random item from objects, with the weighting defined by weights
    (which must sum to 1).
     N/A cs N/A N/A np cumsum weights N/A idx N/A sum N/A cs N/A N/A N/A np random rand N/A N/A objects N/A idx N/A softmax N/A N/A x N/A N/A N/A shifted N/A x N/A N/A np max x axis 1 keepdims True N/A expx N/A N/A np exp shifted N/A N/A expx N/A N/A np sum expx axis 1 keepdims True N/A softmax_sym N/A N/A x N/A N/A N/A N/A N/A N/A N/A theano tensor nnet softmax x N/A cat_entropy N/A N/A x N/A N/A N/A N/A N/A N/A np sum N/A x N/A N/A np log x axis 1 N/A cat_perplexity N/A N/A x N/A N/A N/A N/A N/A np exp N/A cat_entropy x N/A explained_variance_1d N/A N/A ypred y N/A N/A N/A N/A N/A N/A y ndim 1 N/A N/A ypred ndim 1 N/A vary N/A N/A np var y N/A N/A N/A np isclose vary 0 N/A N/A N/A N/A N/A np var ypred 0 N/A N/A 0 N/A N/A 1 N/A N/A N/A abs N/A 1 N/A N/A N/A np var N/A y ypred N/A vary 1e-08 100000.0 N/A N/A ipdb N/A N/A N/A ipdb set_trace N/A N/A 1 N/A N/A N/A np var N/A y ypred N/A vary 1e-08 N/A to_onehot N/A N/A ind dim N/A N/A N/A ret N/A N/A np zeros dim N/A N/A ret N/A ind 1 N/A ret N/A to_onehot_n N/A N/A inds dim N/A N/A N/A ret N/A N/A np zeros N/A N/A len inds dim N/A N/A ret N/A N/A N/A N/A np arange N/A len inds inds 1 N/A ret N/A to_onehot_sym N/A N/A ind dim N/A N/A N/A N/A N/A ind ndim 1 N/A N/A N/A N/A N/A theano tensor extra_ops to_one_hot ind dim N/A from_onehot N/A N/A v N/A N/A N/A N/A N/A N/A N/A np nonzero v N/A 0 N/A 0 N/A from_onehot_n N/A N/A v N/A N/A N/A N/A N/A N/A np nonzero v N/A 1 N/A normalize_updates N/A N/A old_mean old_std new_mean new_std old_W old_b N/A N/A N/A 
    Compute the updates for normalizing the last (linear) layer of a neural
    network
     N/A new_W N/A N/A old_W N/A old_std N/A 0 N/A N/A new_std N/A 0 1e-06 N/A new_b N/A N/A N/A N/A old_b N/A old_std N/A 0 N/A old_mean N/A 0 N/A new_mean N/A 0 N/A N/A new_std N/A 0 1e-06 N/A N/A OrderedDict N/A N/A old_W N/A N/A TT cast new_W N/A old_W dtype N/A old_b N/A N/A TT cast new_b N/A old_b dtype N/A old_mean new_mean N/A old_std new_std N/A discount_cumsum N/A N/A x discount N/A N/A N/A N/A N/A N/A N/A scipy signal lfilter N/A 1 N/A 1 N/A discount N/A x N/A -1 axis 0 N/A -1 N/A discount_return N/A N/A x discount N/A N/A N/A N/A N/A np sum N/A x N/A discount N/A N/A np arange N/A len x N/A rk4 N/A N/A derivs y0 t N/A args kwargs N/A N/A 
    Integrate 1D or ND system of ODEs using 4-th order Runge-Kutta.
    This is a toy implementation which may be useful if you find
    yourself stranded on a system w/o scipy.  Otherwise use
    :func:`scipy.integrate`.

    *y0*
        initial state vector

    *t*
        sample times

    *derivs*
        returns the derivative of the system and has the
        signature ``dy = derivs(yi, ti)``

    *args*
        additional arguments passed to the derivative function

    *kwargs*
        additional keyword arguments passed to the derivative function

    Example 1 ::

        ## 2D system

        def derivs6(x,t):
            d1 =  x[0] + 2*x[1]
            d2 =  -3*x[0] + 4*x[1]
            return (d1, d2)
        dt = 0.0005
        t = arange(0.0, 2.0, dt)
        y0 = (1,2)
        yout = rk4(derivs6, y0, t)

    Example 2::

        ## 1D system
        alpha = 2
        def derivs(x,t):
            return -alpha*x + exp(-t)

        y0 = 1
        yout = rk4(derivs, y0, t)


    If you have access to scipy, you should probably be using the
    scipy.integrate tools rather than this function.
     N/A N/A N/A Ny N/A len y0 N/A N/A N/A TypeError N/A N/A yout N/A N/A np zeros N/A N/A len t N/A np float_ N/A N/A yout N/A N/A np zeros N/A N/A len t Ny N/A np float_ N/A N/A yout N/A 0 y0 N/A i 0 N/A i N/A N/A np arange N/A N/A len t 1 N/A N/A thist N/A t N/A i N/A dt N/A N/A t N/A N/A i 1 thist N/A dt2 N/A dt 2.0 N/A y0 N/A yout N/A i N/A k1 N/A N/A np asarray N/A derivs y0 thist args kwargs N/A k2 N/A N/A np asarray N/A derivs N/A y0 N/A dt2 k1 N/A thist dt2 args kwargs N/A k3 N/A N/A np asarray N/A derivs N/A y0 N/A dt2 k2 N/A thist dt2 args kwargs N/A k4 N/A N/A np asarray N/A derivs N/A y0 N/A dt k3 N/A thist dt args kwargs N/A N/A yout N/A N/A i 1 N/A y0 N/A N/A dt 6.0 N/A N/A N/A k1 N/A 2 k2 N/A 2 k3 k4 N/A yout N/A