def warped_gp_cubic_sine(max_iters=<NUM_LIT:100>):
X = (<NUM_LIT:2> * np.pi) * np.random.random(<NUM_LIT>) - np.pi<EOL>Y = np.sin(X) + np.random.normal(<NUM_LIT:0>,<NUM_LIT>,<NUM_LIT>)<EOL>Y = np.array([np.power(abs(y),float(<NUM_LIT:1>)/<NUM_LIT:3>) * (<NUM_LIT:1>,-<NUM_LIT:1>)[y<<NUM_LIT:0>] for y in Y])<EOL>X = X[:, None]<EOL>Y = Y[:, None]<EOL>warp_k = GPy.kern.RBF(<NUM_LIT:1>)<EOL>warp_f = GPy.util.warping_functions.TanhFunction(n_terms=<NUM_LIT:2>)<EOL>warp_m = GPy.models.WarpedGP(X, Y, kernel=warp_k, warping_function=warp_f)<EOL>warp_m['<STR_LIT>'].constrain_fixed(<NUM_LIT:1.0>)<EOL>m = GPy.models.GPRegression(X, Y)<EOL>m.optimize_restarts(parallel=False, robust=True, num_restarts=<NUM_LIT:5>, max_iters=max_iters)<EOL>warp_m.optimize_restarts(parallel=False, robust=True, num_restarts=<NUM_LIT:5>, max_iters=max_iters)<EOL>print(warp_m)<EOL>print(warp_m['<STR_LIT>'])<EOL>warp_m.predict_in_warped_space = False<EOL>warp_m.plot(title="<STR_LIT>")<EOL>warp_m.predict_in_warped_space = True<EOL>warp_m.plot(title="<STR_LIT>")<EOL>m.plot(title="<STR_LIT>")<EOL>warp_m.plot_warping()<EOL>pb.show()<EOL>
A test replicating the cubic sine regression problem from
Snelson's paper.