Commit 564a4d82309a2e99fb2c06e2c1703528dd73078a
1 parent
e5381878
allow PCA training to continue with fewer retained eigenvectors
Showing
1 changed file
with
4 additions
and
2 deletions
openbr/plugins/eigen3.cpp
| ... | ... | @@ -177,8 +177,10 @@ protected: |
| 177 | 177 | keep = i - drop; |
| 178 | 178 | } |
| 179 | 179 | } else { |
| 180 | - if (keep + drop > allEVals.rows()) | |
| 181 | - qFatal("Insufficient samples, needed at least %d but only got %d.", (int)keep + drop, (int)allEVals.rows()); | |
| 180 | + if (keep + drop > allEVals.rows()) { | |
| 181 | + qWarning("Insufficient samples, needed at least %d but only got %d.", (int)keep + drop, (int)allEVals.rows()); | |
| 182 | + keep = allEVals.rows() - drop; | |
| 183 | + } | |
| 182 | 184 | } |
| 183 | 185 | |
| 184 | 186 | // Keep highest energy vectors | ... | ... |