Commit 5cea44a2 authored by Davis King's avatar Davis King

Added a max runtime option.

parent 918bbd5d
...@@ -133,6 +133,19 @@ namespace dlib ...@@ -133,6 +133,19 @@ namespace dlib
scalar_type get_epsilon ( scalar_type get_epsilon (
) const { return eps; } ) const { return eps; }
void set_max_runtime (
const std::chrono::nanoseconds& max_runtime
)
{
solver.set_max_runtime(max_runtime);
}
std::chrono::nanoseconds get_max_runtime (
) const
{
return solver.get_max_runtime();
}
void set_max_cache_size ( void set_max_cache_size (
unsigned long max_size unsigned long max_size
) )
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "../image_processing/object_detector_abstract.h" #include "../image_processing/object_detector_abstract.h"
#include "../image_processing/box_overlap_testing_abstract.h" #include "../image_processing/box_overlap_testing_abstract.h"
#include "../image_processing/full_object_detection_abstract.h" #include "../image_processing/full_object_detection_abstract.h"
#include <chrono>
namespace dlib namespace dlib
...@@ -63,6 +64,8 @@ namespace dlib ...@@ -63,6 +64,8 @@ namespace dlib
(note that only the "configuration" of scanner is copied. (note that only the "configuration" of scanner is copied.
I.e. the copy is done using copy_configuration()) I.e. the copy is done using copy_configuration())
- #auto_set_overlap_tester() == true - #auto_set_overlap_tester() == true
- #get_max_runtime() == std::chrono::hours(24*356*290)
(i.e. 290 years, so basically forever)
!*/ !*/
const image_scanner_type& get_scanner ( const image_scanner_type& get_scanner (
...@@ -144,6 +147,22 @@ namespace dlib ...@@ -144,6 +147,22 @@ namespace dlib
of its optimal value". of its optimal value".
!*/ !*/
void set_max_runtime (
const std::chrono::nanoseconds& max_runtime
);
/*!
ensures
- #get_max_runtime() == max_runtime
!*/
std::chrono::nanoseconds get_max_runtime (
) const;
/*!
ensures
- returns the maximum amount of time we will let .train() run before
making it terminate.
!*/
void set_max_cache_size ( void set_max_cache_size (
unsigned long max_size unsigned long max_size
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment