Commit db2f60b9 authored by Davis King's avatar Davis King

Changed the cross_validate_trainer_threaded() function so that it is a little bit

more memory efficient.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403647
parent 1f508170
......@@ -46,13 +46,17 @@ namespace dlib
typename matrix_type
>
void operator()(
const job<trainer_type>& j,
job<trainer_type>& j,
matrix_type& result
)
{
try
{
result = test_binary_decision_function(j.trainer.train(j.x_train, j.y_train), j.x_test, j.y_test);
// Do this just to make j release it's memory since people might run threaded cross validation
// on very large datasets. Every bit of freed memory helps out.
j = job<trainer_type>();
}
catch (invalid_svm_nu_error&)
{
......
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