MCPcopy Create free account
hub / github.com/davisking/dlib / configure_trainer

Function configure_trainer

tools/python/src/sequence_segmenter.cpp:348–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346
347template <typename T>
348void configure_trainer (
349 const std::vector<std::vector<dense_vect> >& samples,
350 structural_sequence_segmentation_trainer<T>& trainer,
351 const segmenter_params& params
352)
353{
354 pyassert(samples.size() != 0, "Invalid arguments. You must give some training sequences.");
355 pyassert(samples[0].size() != 0, "Invalid arguments. You can't have zero length training sequences.");
356 pyassert(params.window_size != 0, "Invalid window_size parameter, it must be > 0.");
357 pyassert(params.epsilon > 0, "Invalid epsilon parameter, it must be > 0.");
358 pyassert(params.C > 0, "Invalid C parameter, it must be > 0.");
359 const long dims = samples[0][0].size();
360
361 trainer = structural_sequence_segmentation_trainer<T>(T(dims, params.window_size));
362 trainer.set_num_threads(params.num_threads);
363 trainer.set_epsilon(params.epsilon);
364 trainer.set_max_cache_size(params.max_cache_size);
365 trainer.set_c(params.C);
366 if (params.be_verbose)
367 trainer.be_verbose();
368}
369
370// ----------------------------------------------------------------------------------------
371

Callers 4

train_denseFunction · 0.85
train_sparseFunction · 0.85

Calls 8

maxFunction · 0.50
max_index_plus_oneFunction · 0.50
sizeMethod · 0.45
set_num_threadsMethod · 0.45
set_epsilonMethod · 0.45
set_max_cache_sizeMethod · 0.45
set_cMethod · 0.45
be_verboseMethod · 0.45

Tested by

no test coverage detected