Commit Graph

540 Commits

Author SHA1 Message Date
Peter Würtz
8aebef2459 Use global RNG for training RTrees. 2019-12-29 21:59:14 +01:00
Brian Wignall
f9c514b391 Fix spelling typos
backport commit 659ffaddb4
2019-12-27 12:46:53 +00:00
Alexander Alekhin
41af8aa046 Merge pull request #16017 from berak:fix_svm_train_auto 2019-11-29 11:38:22 +00:00
berak
0dfab6bbd0 ml: fix check in SVM::trainAuto 2019-11-28 20:33:58 +01:00
Maksim Shabunin
5ff1fababc Merge pull request #15959 from mshabunin:refactor-ml-tests
ml: refactored tests

* use parametrized tests where appropriate
* use stable theRNG in most tests
* use modern style with EXPECT_/ASSERT_ checks
2019-11-25 23:03:16 +03:00
Alexander Alekhin
7ec91aefc1 python: force using of ArgInfo 2019-11-15 19:16:22 +03:00
Alexander Alekhin
fef7fc343e ml: add checks of empty train data 2019-09-22 11:12:19 +00:00
luz.paz
fcc7d8dd4e Fix modules/ typos
Found using `codespell -q 3 -S ./3rdparty -L activ,amin,ang,atleast,childs,dof,endwhile,halfs,hist,iff,nd,od,uint`

backporting of commit: ec43292e1e
2019-08-16 17:34:29 +03:00
Ahmed Ashour
5c56b8ce92 java: generated code to have javadoc 2019-06-05 12:44:03 +02:00
seungju
ceff82877d fix a typo in md file
fix a typo in ml_intro.md, tress -> trees
2019-05-01 14:05:33 +02:00
LaurentBerger
621e3eaed8 Add Ptr KNearest::load and python binding 2019-04-16 16:32:37 +02:00
Alexander Alekhin
a0a1fb5fec python: discover tests from module/misc/python/test paths 2019-04-10 18:35:35 +00:00
npochhi
f1a99995c4 Changed eps checking condition 2019-03-14 14:01:34 +05:30
Alexander Alekhin
7d24727184 ml: handle sigmoid NaN result (should be Inf)
- added more debug checks
2019-03-01 13:47:45 +03:00
klemens
5d9c6723ee spelling fixes
backport 997b7b18af
2019-02-11 15:35:10 +03:00
Hannah McLaughlin
418898029c Merge pull request #13718 from lochsh:svm-sigmoid-fix
SVM sigmoid kernel fix (issue #13621) (#13718)

* Added test for sigmoid case for retrieving support vectors

* undo unhelpful test

* add test for sigmoid SVM with data that is easily separable into two concentric circles

* Update sigmoid kernel to use tanh(gamma * <x, y> + coef0) instead of -tanh(gamma * <x, y> + coef0)

* remove unnecessary constraint on coef0

* cleanup

* fixing inappropriate use of doubles

* Add f to float literal

* replace CV_Assert with ASSERT_EQ where appropriate
2019-01-31 15:34:36 +03:00
Hamdi Sahloul
a39e0daacf Utilize CV_UNUSED macro 2018-09-07 20:33:52 +09:00
berak
e13f6ded7f ml: fix adjusting K in KNearest (#12358) 2018-08-31 16:07:53 +03:00
Alexander Alekhin
6e84abc746 ml: don't use "getSubVector()" with 2D matrix
It is designed for 1D vectors only
2018-08-18 20:50:36 +00:00
Alexander Alekhin
7ee69740e8 ml(test): test different samples layout of TrainData 2018-08-17 16:57:20 +03:00
luz.paz
2003eb1b9b Misc. typos
Found via `codespell -q 3 -I ../opencv-whitelist.txt --skip="./3rdparty"`
2018-07-31 18:44:23 +03:00
Maksim Shabunin
cbb1e867e5 More issues found by static analysis 2018-07-24 16:04:42 +03:00
Maksim Shabunin
1da46fe6fb Fixed issues found by static analysis (mostly DBZ) 2018-07-17 16:14:54 +03:00
Alexander Alekhin
b09a4a98d4 opencv: Use cv::AutoBuffer<>::data() 2018-07-04 19:11:29 +03:00
Alexander Alekhin
d1d7408a20 Merge pull request #11502 from berak:fix_knearest 2018-05-11 11:47:13 +00:00
berak
9b0ef7bb17 ml: fix caching of internal state when changing the impl in KNearest 2018-05-11 12:20:17 +02:00
Alexander Alekhin
6b581c4e51 build: unreachable code after CV_Error() (part 2) 2018-04-24 16:03:40 +03:00
lopespt
65d816c3b5 Adds efficient sort algorithm to KNearest 2018-04-04 09:35:58 -03:00
Alexander Alekhin
4d0dd3e509 ml: apply CV_OVERRIDE/CV_FINAL 2018-03-28 18:43:27 +03:00
Vadim Pisarevsky
284e5231c5 Merge pull request #11171 from codingforfun:fix_11143 2018-03-28 12:47:37 +00:00
codingforfun
24e2e0d3f9 #11143 [FIX] Normalize node risk with sample weight sum
In case of regression trees, node risk is computed as sum of squared
error. To get a meaningfull value to compare with it needs to be
normalized to the number of samples in the node (or more generally to
the sum of sample weights in this node). Otherwise the sum of squared
error is highly dependend on the number of samples in the node and
comparision with `regressionAccuracy` parameter is not very meaningful.

After normalization `node_risk` means in fact sample variance for all
samples in the node, which makes much more sence and seams to be what
was originaly intended by the code given that node risk is later used as
a split termination criteria by
```
sqrt(node.node_risk) < params.getRegressionAccuracy()
```
2018-03-27 15:39:36 +02:00
Maksim Shabunin
92e9d4ec3a Fixed several issues detected by static analysis 2018-02-22 17:11:33 +03:00
Alexander Alekhin
12d2bd4adb ml: refactor ML_ANN test 2018-02-19 21:35:48 +03:00
luz.paz
e805a55a5b Misc. modules/ typos (cont.)
Found via `codespell`
2018-02-12 10:15:36 -05:00
Alexander Alekhin
4a297a2443 ts: refactor OpenCV tests
- removed tr1 usage (dropped in C++17)
- moved includes of vector/map/iostream/limits into ts.hpp
- require opencv_test + anonymous namespace (added compile check)
- fixed norm() usage (must be from cvtest::norm for checks) and other conflict functions
- added missing license headers
2018-02-03 19:39:47 +00:00
Alexander Alekhin
00e43a9022 ml(ANN_MLP): ensure that train() call is always successful 2017-12-22 18:50:04 +00:00
Alexander Alekhin
289a8da39e ml: simplify interfaces of SimulatedAnnealingSolver 2017-12-22 16:35:48 +03:00
LaurentBerger
e43997dbb5 Calcerror uses now weighted samples (#10346)
* Calcerror uses now sample weights

* catree comment in #10319
2017-12-20 17:24:46 +03:00
Alexander Alekhin
aef3019152 ml: fix SimulatedAnnealingSolver interface 2017-12-15 21:44:32 +03:00
catree
0a439570a0 Move SimulatedAnnealingSolver::Impl in cpp file. Fix some typos. 2017-12-15 14:09:59 +01:00
LaurentBerger
7ad308ea47 Simulated Annealing for ANN_MLP training method (#10213)
* Simulated Annealing for ANN_MLP training method

* EXPECT_LT

* just to test new data

* manage RNG

* Try again

* Just run buildbot with new data

* try to understand

* Test layer

* New data- new test

* Force RNG in backprop

* Use Impl to avoid virtual method

* reset all weights

* try to solve ABI

* retry

* ABI solved?

* till problem with dynamic_cast

* Something is wrong

* Solved?

* disable backprop test

* remove ANN_MLP_ANNEALImpl

* Disable weight in varmap

* Add example for SimulatedAnnealing
2017-12-15 13:57:39 +03:00
Vadim Pisarevsky
614e254331 Merge pull request #10170 from LaurentBerger:Issue10166 2017-11-29 09:51:20 +00:00
LaurentBerger
a44573c43b Add ReLU and LeakyReLU activation function in ml module 2017-11-28 11:02:05 +01:00
LaurentBerger
606a5fd537 Try to solve issue 10166 2017-11-27 13:13:05 +01:00
LaurentBerger
b9cf65e905 Parallel version of calcError in statmodel 2017-11-09 21:29:06 +01:00
Vadim Pisarevsky
70c5d69640 Merge pull request #9310 from r2d3:svm_parallel 2017-09-18 09:32:41 +00:00
Vadim Pisarevsky
42cd061af0 Merge pull request #9581 from sovrasov:rtree_disable_cv 2017-09-13 13:20:52 +00:00
Maksim Shabunin
248e2c7d47 Fixed some issues found by static analysis 2017-09-08 12:22:12 +03:00
Vladislav Sovrasov
3eb9a655c7 ml: disable not implemented k-fold validation in RTrees 2017-09-07 15:49:46 +03:00
David Geldreich
7c334f45c6 trainAuto: uses parallel_for_ to dispatch all parameters combination to test 2017-08-08 13:27:02 +02:00