I was using the data augmentation recommended for the ImageNet dataset, which is not well suited
for CIFAR-10.
After doing so, the test accuracy increased by 1 point.
I was using the normalized features za as both matrices, instead of za and zb.
I noticed this because the empirical cross-correlation matrix was symmetrical,
which is not supposed to. It does not affect anything, as it was computed
properly in the loss.
* - moved for_each_in_tuple() to algs.h. Seems like a better place
- took the opportunity to deprecated the old type traits and make them aliases to things in the standard library
* - made bools() constexpr
* - removed ugly template recursion version of for_each_in_tuple(). Recursion is bad and is one of the reasons why buid times are so long.
- Use generic lambdas. Much better.
* - missing include
* - just make old deprecates stuff aliases to standard library things
- use switch_() for compile time branching. It's awesome. It means less code and less templates.
* - fixed make_compile_time_integer_range. Didn't realize it counted like Matlab. Very weird
* - nice example usage of switch_(). it will be trivially updated to if constexpr() in a couple years when dlib requires C++17
* - deduce return type
- use generic lambdas
* - for some reason these have to specify the return type. I don't understand. Will fix in a bit.
* - yet another template recursion removed. Better compile times in theory. Every little helps
* whoops
* use decay_t
* - type traits go in type_traits.h
- things found in <utility> go in utility.h
- algs.h doesn't contain any type traits. It just includes type_traits.h
* only need type_traits.h header
* use fold expressions if possible
* use is_any from type_traits.h
* - moved is_convertible to type_traits.h. Also make it an alias for std::is_convertible
* moved is_convertible
* use type traits in standard library
* - use standard library
* use standard library
* MSVC bug workaround
* missing dlib namespace
* fix typo
* - reverting back compile_time_integer_list and make_compile_time_integer_range
* - making sure nothing uses compile_time_integer_list or make_compile_time_integer_range
* - added pop_front for index_sequence
- making sure nothing uses compile_time_integer_list or make_compile_time_integer_range
- use auto
* - use integer_sequence
* - added docs for get_type_id(tag)
* - use __type_pack_element if available
* - hmm, reverting, some pre-processors break here. Don't know why.
Co-authored-by: pf <pf@me>
* Update Pybind11 to v2.10.0
* Update numpy_image to work with latest Pybind11
* I don't know why I have to do this now...
* Try to make macOS use Python3... Really?
* Try to make macOS use Python3... Again
* Try to make macOS use Python3... Once more
* Install dependencies with pip3
* - Use C++14 library stuff if possible
* Added a C++14 of if constexpr(). I think it's pretty great. Very similar to hana::if_
* - added some example usages
* - added is_detected
- added more tests
* - fix
* - fix
* - much better. thanks Davis
* - fix
* - fix
* - fix
* - Davis, I think you were wrong. Here, everything breaks without the _ function
* - Fixed but docs suck
* - use C++14 stuff
* - put function body after docs
* - docs maybe slightly better but still suck
* - badly placed brace
* - maybe slightly better English
* - better API i think
Co-authored-by: pf <pf@me>
* Do the bias addition in the convolution in a separate call
Fixes#2655.
Somehow, doing it in a single call is slower.
* Grammar
* The change should be this, really
* Small YOLO loss improvements
* Refactor iou_anchor_threshold logic
* Simplify iou_anchor_threshold logic a bit more
* Be more robust in the iou_anchor_threshold check
* Add multiclass SVM trainer to svm/auto.h
* Use a matrix<double> and add an overload for matrix<float>
* Replace typedef with using and use normalizer from normalized_function
* Remove extra ;
* use better names for decision function variables
* fix comments format and grammar
* remove unneeded includes
* Update dlib/svm/auto_abstract.h
* Update the assert to use 3 samples (as there is 3 fold CV)
* Remove unneeded captures in lambda
* Update dlib/svm/auto_abstract.h
* Update dlib/svm/auto_abstract.h
Co-authored-by: Davis E. King <davis685@gmail.com>
* Use only a fraction of labels for the multiclass SVM in SSL example
This change makes the self-supervised example more close to reality:
usually, only a fraction of the dataset is labeled, but we can harness
the whole dataset by using a self-supervised method and then train the
classifier using the fraction of labeled data.
Using 10% of the labels results in a test accuracy of 87%, compared to
the 89% we got when training the multiclass SVM with all labels.
I just added an option to change the fraction of labeled data, so that
users can experiment with it.
* Update examples/dnn_self_supervised_learning_ex.cpp
Co-authored-by: Davis E. King <davis685@gmail.com>
* [MATH] beginnings of some special math stuff like bessel functions and so on. This will be useful for filter design and further down the line computing STFTs and who knows, maybe some DSP
* placeholder code
* copy pasted from libstdc++ pretty much
* [MATH] refactoring and unit tests
* [MATH] added constants
* [MATH] more tests
* Am i missing a namespace ? What the hell is gcc-11 complaining about
* - missing header for std::max (algorithm)
- bad brackets
- unambiguous call to cyl_bessel_(i/j)
* - added kaiser function
* - added kaiser function
* - inline
* - use dlib/numeric_constants.h
- made all the constants constexpr. Don't think it makes a difference but make things constexpr if you can
- added some decimals so it's consistent with what's in the standard library
* stripped boost
* float and double aren't constexpr-able
* - explicit implementation without frills. Not as accurate as libstdc++ or boost but much simpler, does the job and no license
* - use DLIB_ASSERT
- added documentation
* fix spelling
* - check template parameters are floating point
- added tests for kaiser using data generated from numpy
* - use strong types and function overloading
* - added more window functions
* - better docs
- don't need inline templates, just templates
* - added the Hann window. That's the default used for STFT in scipy and matlab
* - added window overloads for dlib::matrix
* - added kaiser overloads for dlib::matrix
* - suppress complaint about narrowing
* - unit tests for the matrix overloads
* - unit tests for the matrix overloads
* - you can now call windows using an enum
* - refactored Window to WindowType and Windowtype to WindowSymmetry to avoid conflicts with GUI library which also defines Window
* compute real values
* first draft at stft(), istft(), stftr() and istftr()
* Added tests for stft()
* more stft() tests
* fix mismatched signed-ness
* more tests
* - more checks
- docs
* - signed vs unsigned comparision warning
* - more tests
* - added more precision to the scipy generated data and lowered tol
* made docs a little bit more explicit
* removed new lines
* test all the windows
* reduced tol a bit
* - mods as per code review
* - mods as per code review
* - mods as per code review
* - tol is reduced
* - refactored WindowType to window_type
- added abstract file for windows
* Got rid of switch-wrapped window function
* Got rid of switch-wrapped window function
* Don't need matrix expressions for windows anymore
* Don't need matrix expressions for windows anymore
* Don't need matrix expressions for windows anymore
* Not using an enum to control the window type anymore.
* Not using an enum to control the window type anymore.
* Not using an enum to control the window type anymore.
* can't use a generic lambda in C++11
* reduced number of tests
* Don't needlessly convert float to double to float to double to float ... Added static assert in bessel functions. Use lambdas!
* If we're going to start using C++14, we don't need trailing return types. Just use auto. Much easier. Just let your IDE tell you want the return type is.
* Enable C++14. This is a basic change. I feel like all the cmake stuff in dlib needs to be updated to the v3 era.
* c++14 simplification
* trying another approach at enforcing C++14, and make sure dtest uses it
* keep windows happy
* trying to keep windows happy
* revert change
* Apply suggestions from code review
* - removed print statement
* - more accurate docs
* - don't use /*!!*/ for comments. That messes with dlib docgen
- more docs
* - better function names. Hopefully, it's clearer what they are doing
* Update dlib/matrix/matrix_fft_abstract.h
* Update dlib/matrix/matrix_fft_abstract.h
* Update dlib/matrix/matrix_fft_abstract.h
* Update dlib/matrix/matrix_fft_abstract.h
Co-authored-by: pfeatherstone <peter@me>
Co-authored-by: pf <pf@me>
Co-authored-by: Davis E. King <davis685@gmail.com>
* Use add_compile_definitions, enable -Wpedantic and use colors
* Use lround in rectangle and drectangle
* Use round in bigint
* Use round in canvas_drawing
* Modernize image_transforms
* Modernize image_pyramid
* Fix error in image_pyramid
* Modernize matrix
* Fix error in image_pyramid again
* Modernize fhog test
* Modernize image_keypoint/surf
* Remove extra ;
* Add some improvements to the YOLO loss layer
Notably:
- stabilized bounding box regression loss during training by smoothing the gradient
- added the possibility to compute the iou_anchor_threshod adaptively with ATSS
(adaptive training sample selection)
- make use of the detection_confidence field in the truth box for class balanced loss
- added an optional gamma parameter to be able to use the focal loss in the classifier
* Added method to return a non-const reference to yolo_options
Also added the gamma_cls to loss_details operator<<
* Add focal gamma for objectness, too
* Fix yolo_options deserialization logic
* Remove non-const reference method to yolo_options
* use weight only for positive class, and be more consistent with floating types
* Use chrono in console progress indicator and add finish method
* Default print status to std::clog
* Print ellapsed time in parallel_for_verbose
* Fix typo
* Fix typo again
* Update release notes
* Fix spacing
* [TYPE_SAFE_UNION] removed explicit swap(). let the compiler define swap from move semantics
* - added type traits:
are_nothrow_move_construtible
are_nothrow_move_assignable
are_nothrow_copy_construtible
are_nothrow_copy_assignable
- everything has (conditional) noexcept specifiers
* - formatting
- bug fix
* - added .swap() back in
* - type traits
- added .swap(item) and swap(a,b) back in, but with some cleanup and all the noexcept
* added docs for swap(a,b) back in
Co-authored-by: pfeatherstone <peter@me>