From 225da0226e4e9d54e97aee488ac2b5ed4e813443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9D=D1=83=D0=B6?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9?= Date: Tue, 7 Apr 2015 15:09:47 +0300 Subject: [PATCH 1/4] Fix bug in SVM::trainAuto --- modules/ml/src/svm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/svm.cpp b/modules/ml/src/svm.cpp index 449eb8dcd4..b74df5f0a4 100644 --- a/modules/ml/src/svm.cpp +++ b/modules/ml/src/svm.cpp @@ -1787,7 +1787,7 @@ public: if( !do_train( temp_train_samples, temp_train_responses )) continue; - for( i = 0; i < test_sample_count; i++ ) + for (i = 0; i < train_sample_count; i++) { j = sidx[(i+start+train_sample_count) % sample_count]; memcpy(temp_train_samples.ptr(i), samples.ptr(j), sample_size); From 0c24ccf53897c60dff19193623a97fc4713ce14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9D=D1=83=D0=B6?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9?= Date: Tue, 7 Apr 2015 15:43:59 +0300 Subject: [PATCH 2/4] Revert "Fix bug in SVM::trainAuto" This reverts commit 225da0226e4e9d54e97aee488ac2b5ed4e813443. --- modules/ml/src/svm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/svm.cpp b/modules/ml/src/svm.cpp index b74df5f0a4..449eb8dcd4 100644 --- a/modules/ml/src/svm.cpp +++ b/modules/ml/src/svm.cpp @@ -1787,7 +1787,7 @@ public: if( !do_train( temp_train_samples, temp_train_responses )) continue; - for (i = 0; i < train_sample_count; i++) + for( i = 0; i < test_sample_count; i++ ) { j = sidx[(i+start+train_sample_count) % sample_count]; memcpy(temp_train_samples.ptr(i), samples.ptr(j), sample_size); From 3646967deb9b48f45c44203e5c96836a8a180218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9D=D1=83=D0=B6?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9?= Date: Tue, 7 Apr 2015 15:48:30 +0300 Subject: [PATCH 3/4] Fix bug in SVM::trainAuto --- modules/ml/src/svm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/svm.cpp b/modules/ml/src/svm.cpp index 449eb8dcd4..95b5fb97d5 100644 --- a/modules/ml/src/svm.cpp +++ b/modules/ml/src/svm.cpp @@ -1787,7 +1787,7 @@ public: if( !do_train( temp_train_samples, temp_train_responses )) continue; - for( i = 0; i < test_sample_count; i++ ) + for( i = 0; i < train_sample_count; i++ ) { j = sidx[(i+start+train_sample_count) % sample_count]; memcpy(temp_train_samples.ptr(i), samples.ptr(j), sample_size); From e800800bec8596127274f359e744723a7371b5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9D=D1=83=D0=B6?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9?= Date: Wed, 8 Apr 2015 12:43:38 +0300 Subject: [PATCH 4/4] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 3646967deb9b48f45c44203e5c96836a8a180218 Author: Сергей Нужный Date: Tue Apr 7 15:48:30 2015 +0300 Fix bug in SVM::trainAuto commit 0c24ccf53897c60dff19193623a97fc4713ce14e Author: Сергей Нужный Date: Tue Apr 7 15:43:59 2015 +0300 Revert "Fix bug in SVM::trainAuto" This reverts commit 225da0226e4e9d54e97aee488ac2b5ed4e813443. commit 225da0226e4e9d54e97aee488ac2b5ed4e813443 Author: Сергей Нужный Date: Tue Apr 7 15:09:47 2015 +0300 Fix bug in SVM::trainAuto --- modules/ml/src/svm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/svm.cpp b/modules/ml/src/svm.cpp index 449eb8dcd4..95b5fb97d5 100644 --- a/modules/ml/src/svm.cpp +++ b/modules/ml/src/svm.cpp @@ -1787,7 +1787,7 @@ public: if( !do_train( temp_train_samples, temp_train_responses )) continue; - for( i = 0; i < test_sample_count; i++ ) + for( i = 0; i < train_sample_count; i++ ) { j = sidx[(i+start+train_sample_count) % sample_count]; memcpy(temp_train_samples.ptr(i), samples.ptr(j), sample_size);