![]() ![]() Multilinear: 10000 interpolations, 1 clocks, 0.001000 secĪ Python interface is provided, using Andreas Klöckner's pyublas library. begin ()) t2 = clock () printf ( "multilinear: %d interpolations, %d clocks, %f sec \n ", num_interp_elements, ( t2 - t1 ), (( double )( t2 - t1 )) / CLOCKS_PER_SEC ) // calculate the squared errors std :: vector true_f_vals ( num_interp_elements ) double SSE = 0.0 for ( int i = 0 i 0.137236 interp_vec ( num_interp_elements, interp_x_list. begin ()) // interpolate a sequence of values clock_t t1, t2 t1 = clock () interp_ML. size () std :: vector interp_x1 ( num_interp_elements ) std :: vector interp_x2 ( num_interp_elements ) for ( int i = 0 i result ( num_interp_elements ) // pass in a sequence of iterators, one for each coordinate std :: vector :: iterator > interp_x_list interp_x_list. begin ())) // interpolate multiple values: create sequences for each coordinate std :: vector interp_grid = linspace ( 0.0, 3.0, length * 10 ) int num_interp_elements = interp_grid. std :: vector linspace ( double first, double last, int len ) printf ( "%f, %f -> %f \n ", args, args, interp_ML. #include #include "linterp.h" // return an evenly spaced 1-d grid of doubles. Davies (1996), "Multidimensional Triangulation and Interpolation for Reinforcement Learning", Proceedings of Neural Information Processing Systems 1996.Weiser
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |