Module Expr Str Import alias Import alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad NameLoad NameLoad vararg kwarg body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Return BinOpAdd BinOpDiv BinOpMult BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Index AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr While NameLoad body TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Break handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body If CompareEq AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr Num orelse AugAssignMult AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Slice AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Slice decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr Assert CompareEq AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Num Return SubscriptLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Index Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr BinOpAdd CompareGt Num NameLoad CompareGt NameLoad Num body Return Num Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Slice NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num keyword NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body AugAssignAdd NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return IfExp Call AttributeLoad NameLoad attr NameLoad UnaryOpUSub NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Slice NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num keyword NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body AugAssignAdd NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return UnaryOpUSub NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Num Index Num Index AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr orelse Assign NameStore NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num NameLoad If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr orelse Assign SubscriptStore NameLoad Index Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Call AttributeLoad NameLoad attr BinOpBitAnd CompareLt NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr CompareGt NameLoad UnaryOpUSub AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Num Return TupleLoad SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return TupleLoad SubscriptLoad NameLoad ExtSlice Slice Index Num Slice NameLoad decorator_list decorator_list
N/A N/A 
Created on Oct 12, 2015

@author: Aaron Klein
 N/A logging N/A george N/A numpy np scipy optimize copy deepcopy robo.models.base_model BaseModel N/A logger N/A N/A logging getLogger __name__ GaussianProcess N/A BaseModel N/A __init__ N/A N/A self kernel prior yerr use_gradients basis_func dim N/A None 1e-25 True None None args kwargs N/A N/A 
        Interface to the george GP library. The GP hyperparameter are obtained
        by optimizing the marginal loglikelihood.

        Parameters
        ----------
        kernel : george kernel object
            Specifies the kernel that is used for all Gaussian Process
        prior : prior object
            Defines a prior for the hyperparameters of the GP. Make sure that
            it implements the Prior interface.
        yerr : float
            Noise term that is added to the diagonal of the covariance matrix
            for the cholesky decomposition.
        use_gradients : bool
            Use gradient information to optimize the negative log likelihood
         N/A N/A self kernel kernel N/A N/A self model None N/A N/A self prior prior N/A N/A self yerr yerr N/A N/A self use_gradients use_gradients N/A N/A self basis_func basis_func N/A N/A self dim dim N/A scale N/A N/A self x new_min new_max old_min old_max N/A N/A N/A N/A N/A N/A N/A new_max new_min N/A x old_min N/A old_max old_min new_min N/A train N/A N/A self X Y do_optimize N/A True N/A N/A 
        Computes the cholesky decomposition of the covariance of X and
        estimates the GP hyperparameter by optimizing the marginal
        loglikelihood. The prior mean of the GP is set to the empirical
        mean of the X.

        Parameters
        ----------
        X: np.ndarray (N, D)
            Input data points. The dimensionality of X is (N, D),
            with N as the number of points and D is the number of features.
        Y: np.ndarray (N, 1)
            The corresponding target values.
        do_optimize: boolean
            If set to true the hyperparameters are optimized.
         N/A N/A self X X N/A N/A N/A self basis_func None N/A N/A N/A self X N/A deepcopy X N/A N/A N/A self X N/A N/A N/A N/A self dim N/A N/A self basis_func N/A N/A self X N/A N/A N/A N/A self dim N/A N/A self Y Y N/A N/A self mean N/A N/A np mean Y axis 0 N/A N/A self model N/A N/A george GP N/A self kernel mean N/A self mean N/A True N/A N/A N/A N/A N/A N/A N/A self model compute N/A self X yerr N/A self yerr N/A N/A N/A N/A N/A N/A np linalg LinAlgError N/A N/A N/A N/A self yerr 0.0 N/A N/A N/A self yerr 1e-25 N/A N/A N/A self yerr 10 N/A N/A N/A logger error N/A Cholesky decomposition for the covariance matrix                     of the GP failed.                     Add %s noise on the diagonal. N/A self yerr N/A do_optimize N/A N/A N/A self hypers N/A N/A self optimize N/A N/A N/A logger info N/A HYPERS:  N/A str N/A self hypers N/A N/A N/A N/A self model kernel N/A N/A self hypers N/A N/A N/A self hypers N/A N/A N/A self model kernel N/A N/A get_noise N/A N/A self N/A N/A N/A N/A self yerr N/A N/A N/A N/A N/A N/A self kernel k2 k2 kernel_type 1 N/A N/A N/A N/A N/A N/A self kernel k2 k2 pars N/A 0 N/A nll N/A N/A self theta N/A N/A N/A 
        Returns the negative marginal log likelihood (+ the prior) for
        a hyperparameter configuration theta.
        (negative because we use scipy minimize for optimization)

        Parameters
        ----------
        theta : np.ndarray(H)
            Hyperparameter vector. Note that all hyperparameter are
            on a log scale.

        Returns
        ----------
        float
            lnlikelihood + prior
         N/A N/A N/A np any N/A N/A -10 theta N/A theta 10 N/A N/A 1e+25 N/A N/A N/A N/A self model kernel N/A theta N/A ll N/A N/A N/A self model lnlikelihood N/A N/A self Y N/A N/A N/A 0 quiet True N/A N/A N/A self prior None N/A N/A ll N/A N/A N/A self prior lnprob theta N/A N/A N/A N/A np isfinite ll N/A ll 1e+25 N/A grad_nll N/A N/A self theta N/A N/A N/A N/A N/A N/A self model kernel N/A theta N/A gll N/A N/A N/A self model grad_lnlikelihood N/A N/A self Y N/A N/A N/A 0 quiet True N/A N/A N/A self prior None N/A N/A gll N/A N/A N/A self prior gradient theta N/A N/A gll N/A optimize N/A N/A self N/A N/A N/A p0 N/A N/A N/A self model kernel vector N/A N/A self use_gradients N/A N/A results N/A N/A optimize minimize N/A self nll p0 jac N/A self grad_nll N/A N/A results N/A N/A optimize minimize N/A self nll p0 N/A N/A results x N/A predict_variance N/A N/A self X1 X2 N/A N/A N/A 
        Predicts the variance between two test points X1, X2 by
           math: \sigma(X_1, X_2) = k_{X_1,X_2} - k_{X_1,X} * (K_{X,X}
                       + \sigma^2*\mathds{I})^-1 * k_{X,X_2})

        Parameters
        ----------
        X1: np.ndarray (N, D)
            First test point
        X2: np.ndarray (N, D)
            Second test point
        Returns
        ----------
        np.array(N,1)
            predictive variance

         N/A N/A N/A self basis_func None N/A N/A X_test_1 N/A deepcopy X1 N/A N/A X_test_1 N/A N/A N/A N/A self dim N/A N/A self basis_func N/A X_test_1 N/A N/A N/A N/A self dim N/A X_test_2 N/A deepcopy X2 N/A N/A X_test_2 N/A N/A N/A N/A self dim N/A N/A self basis_func N/A X_test_2 N/A N/A N/A N/A self dim N/A N/A X_test_1 X1 N/A X_test_2 X2 N/A x_ N/A N/A np concatenate N/A X_test_1 X_test_2 N/A N/A _ var N/A N/A self predict x_ N/A var N/A var N/A N/A -1 N/A -1 N/A N/A np newaxis N/A var N/A predict N/A N/A self X N/A kwargs N/A N/A 
        Returns the predictive mean and variance of the objective function at
        the specified test point.

        Parameters
        ----------
        X: np.ndarray (N, D)
            Input test points

        Returns
        ----------
        np.array(N,1)
            predictive mean
        np.array(N,1)
            predictive variance

         N/A N/A N/A self basis_func None N/A N/A X_test N/A deepcopy X N/A N/A X_test N/A N/A N/A N/A self dim N/A N/A self basis_func N/A X_test N/A N/A N/A N/A self dim N/A N/A X_test X N/A N/A N/A self model None N/A N/A N/A N/A logger error The model has to be trained first! N/A ValueError N/A N/A mu var N/A N/A N/A self model predict N/A N/A self Y N/A N/A N/A 0 X_test N/A N/A N/A N/A var shape N/A 0 1 N/A N/A var N/A N/A np clip var N/A N/A N/A np finfo N/A var dtype eps N/A np inf N/A N/A N/A var N/A N/A N/A np diag_indices N/A N/A var shape N/A 0 N/A N/A np clip N/A var N/A N/A N/A np diag_indices N/A N/A var shape N/A 0 N/A N/A N/A np finfo N/A var dtype eps N/A np inf N/A N/A var N/A N/A N/A np where N/A N/A var N/A N/A N/A np finfo N/A var dtype eps N/A var N/A N/A N/A N/A np finfo N/A var dtype eps 0 N/A N/A N/A mu N/A N/A N/A N/A np newaxis var N/A sample_functions N/A N/A self X_test n_funcs N/A 1 N/A N/A 
        Samples F function values from the current posterior at the N
        specified test point.

        Parameters
        ----------
        X_test: np.ndarray (N, D)
            Input test points
        n_funcs: int
            Number of function values that are drawn at each test point.

        Returns
        ----------
        np.array(F,N)
            The F function values drawn at the N test points.
         N/A N/A N/A N/A self model sample_conditional N/A N/A self Y N/A N/A N/A 0 X_test n_funcs N/A predictive_gradients N/A N/A self X_test N/A N/A N/A N/A dmdx dvdx N/A N/A N/A self m predictive_gradients Xnew N/A N/A N/A dmdx N/A N/A N/A 0 N/A dvdx N/A N/A