Re: [Dclib-devel] Interrupting training
Brought to you by:
davisking
From: Davis K. <dav...@us...> - 2013-11-05 12:04:45
|
Thanks, I'm glad you like it :) Sure, that should be easy to do. Just add another templated argument to the .train() method. So something like this: template <typename in, typename out, typename cancel_type> return_type train(in,out, cancel_type canceler) { ... // somewhere inside the main loop canceler(iteration_count); ... } Then you can pass in a function object that takes the current iteration and every 100 or 1000 iterations checks the clock (or whatever you want to check) and if it's been to long throws an exception. Let me know which trainers you do this to (or send me a patch file or whatever is convenient) and I'll include the changes into the next dlib release, which should be out in about 6 weeks or so. Cheers, Davis On Tue, Nov 5, 2013 at 6:12 AM, Maurizio Monge <mau...@gm...>wrote: > Dear developers, > thank very much you for dlib, I have found it exceptionally good and > well documented! > I was wondering if (possibly with some tweak or template override) it > could be possible to interrupt the training of an SVM model, for > instance inserting somewhere a hook that could raise an exception. I > am writing a server that allows to be invoked remotely, and I would > like it to allow "cancelling" of training operations. > > Thank you for your attention! > Maurizio Monge > > > ------------------------------------------------------------------------------ > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. > Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and > register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > _______________________________________________ > Dclib-devel mailing list > Dcl...@li... > https://lists.sourceforge.net/lists/listinfo/dclib-devel > |