Commit Graph

1899 Commits

Author SHA1 Message Date
Davis King eef728d280 Simplified the oca implementation slightly. It no longer keeps track of the
best point seen so far.  This change will allow me to use the optimizer in conjunction
with methods for quickly approximating subgradients and risk values without needing
to worry about the optimizer permanently fixating on what it erroneously thinks
is the best point.  Now the optimizer will just keep solving the cutting plane
subproblem and will use that solution as the current iterate and best known
solution.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404170
2011-03-16 23:33:25 +00:00
Davis King bc487527d3 updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404169
2011-03-15 22:48:13 +00:00
Davis King d0f2eb4318 Renamed max_index_value_plus_one() (a function for working with graphs) to
max_index_plus_one() so that it uses the same name as the essentially identical
function for working with sparse vectors.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404168
2011-03-15 22:42:33 +00:00
Davis King d8e7ee4c1d Moved some functions for dealing with sparse vectors out of the svm_c_linear_trainer
implementation and into the sparse_vector.h header.  These are the add_to(), subtract_from(),
and max_index_plus_one() functions.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404167
2011-03-15 22:38:36 +00:00
Davis King 392c7758e5 Added a value_type typedef to matrix_exp so it's easier to write templates
which operate on STL containers and matrix objects.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404166
2011-03-15 02:03:06 +00:00
Davis King 730037dc29 Removed some old comments
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404165
2011-03-13 18:21:50 +00:00
Davis King 23e169da02 Fixed a bug in the kernel_matrix() function. It didn't compile when used with
sparse samples which were of type std::vector<std::pair<> >.  Moreover, some of
the trainers have a dependency on kernel_matrix() so this fix makes those trainers
also work with this kind of sparse sample.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404164
2011-03-13 17:19:56 +00:00
Davis King 2ee75d5f3d updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404163
2011-03-13 17:15:27 +00:00
Davis King 4ecdd03b70 Added an is_pair template for telling if a type is a std::pair object.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404162
2011-03-13 17:13:01 +00:00
Davis King 975abaf93f Fixed a bug in load_libsvm_formatted_data(). Forgot to clear the contents
of the labels output vector before adding the loaded label data.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404161
2011-03-10 01:14:26 +00:00
Davis King 64afc28ec6 Fixed typo in spec
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404160
2011-03-03 22:06:02 +00:00
Davis King 3b98c7bd93 updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404159
2011-03-03 00:43:27 +00:00
Davis King 74fc41c7b4 made a release
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404157
2011-03-03 00:16:51 +00:00
Davis King 6c961389a9 updated release notes
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404156
2011-03-02 23:56:30 +00:00
Davis King 8656126936 Changed the oca optimizer so that it warm starts the QP subproblem
rather than resolving it from scratch during each iteration. This
improves the speed and stability of the algorithm.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404155
2011-03-02 02:24:11 +00:00
Davis King 2df86dedd1 Changed code slightly to avoid a warning from gcc.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404154
2011-02-22 23:34:52 +00:00
Davis King f291361589 Made max_cost_assignment() take a matrix expression rather than an actual matrix.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404153
2011-02-15 22:48:12 +00:00
Davis King 7dcbdcc07b updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404152
2011-02-14 04:07:27 +00:00
Davis King 4e088f05ac Fixed bug in assert.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404151
2011-02-14 03:52:38 +00:00
Davis King 00521ca389 updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404150
2011-02-14 03:37:45 +00:00
Davis King faa43b4446 Added an implementation of the Hungarian algorithm for solving the optimal
assignment problem (in the new max_cost_assignment() routine).

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404149
2011-02-14 03:24:29 +00:00
Davis King a02d50cd7b Fixed typo in comment.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404148
2011-02-13 14:46:05 +00:00
Davis King 5a9381c26b updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404147
2011-02-11 02:11:48 +00:00
Davis King 92d25fab1e Fixed a problem which prevented the any_function unit test from compiling in visual studio 2008.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404146
2011-02-11 02:10:12 +00:00
Davis King a00ab2b747 Made a release
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404145
2011-02-11 01:31:03 +00:00
Davis King 53798e2105 updated release notes
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404144
2011-02-11 00:17:25 +00:00
Davis King 00413b3e90 Added a test for split()
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404143
2011-02-10 23:56:50 +00:00
Davis King bc8479e701 updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404142
2011-02-09 23:00:53 +00:00
Davis King 294f7cfed9 Added a function for splitting up strings which contain a sequence
of delimited tokens.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404141
2011-02-09 22:57:14 +00:00
Davis King 9fd2906bd1 Added a comment about using lambda functions as event handlers.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404140
2011-02-08 23:59:12 +00:00
Davis King a52717a866 Added a unit test for the any_function.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404139
2011-02-08 23:37:54 +00:00
Davis King 3a5602f203 Fixed a bug in any_function which prevented the .get() function
from compiling.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404138
2011-02-08 23:37:29 +00:00
Davis King 714912a6b5 Made the is_function template work with functions of up to 10 arguments.
Previously it only worked up to 5 arguments.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404137
2011-02-08 23:36:42 +00:00
Davis King d751e4e49c updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404136
2011-02-07 23:52:34 +00:00
Davis King 72fbfdb5f8 Fixed a typo in the spec.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404135
2011-02-07 23:32:28 +00:00
Davis King 719dadc388 Added overloads of all the GUI event handlers so that now you can
use general functions as callbacks (via any_function).  This way,
if you have a C++0x compiler, you can use lambda functions with the
event handlers.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404134
2011-02-07 02:36:58 +00:00
Davis King a4441c4619 Switched the event handlers in the gui_widgets from member_function_pointers
to any_functions.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404133
2011-02-07 00:58:02 +00:00
Davis King e2bc112a7c Fixed a typo in the spec for the is_empty() functions. I also added an
is_set() to the any_function so that it's interface is similar to the
member_function_pointer.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404132
2011-02-06 21:31:53 +00:00
Davis King 5d6d7f4b39 Added a factory function to easily create temporary member function pointers.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404131
2011-02-06 21:16:17 +00:00
Davis King 3ad1facf9e Added an any_function which supports the same functionality as std::function from the
upcoming C++0x standard.  I added this so dlib can be modified to easily support lambda
functions while still being compilable on compilers which don't support the new
std::function.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404130
2011-02-06 21:04:20 +00:00
Davis King 8837d626e1 Added tests for the new features of the distance_function object.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404129
2011-02-06 15:03:07 +00:00
Davis King f5801c15d6 Fixed a runtime bug in the distance_function's + and - operators which triggered when
distance_functions with no basis vectors in them were added or subtracted.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404128
2011-02-06 15:02:20 +00:00
Davis King e7ac187107 Made the interface to the approximate_distance_function() a little cleaner and
improved its specification a bit.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404127
2011-02-05 20:29:44 +00:00
Davis King 9e5ce96854 updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404126
2011-02-05 19:07:42 +00:00
Davis King 82fb3682fc Refactored the code in the reduced_decision_function_trainer2. Part of it has been turned into
a global function called approximate_distance_function() which performs the main optimization.  The
reduced_decision_function_trainer2 now depends on this global function.  This changes makes this
function optimizer available for other purposes besides use in the reduced_decision_function_trainer2
object.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404125
2011-02-05 18:29:57 +00:00
Davis King 543e289f72 Improved the distance_function object by turning it into a properly encapsulated class
rather than just a simple struct.  I also added overloaded +, -, *, and / operators
for this object so you can do the kind of arithmetic you would expect on an object
which represents a point in a vector space.  This breaks backwards compatibility
with the previous interface though as the member variables are now private.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404124
2011-02-05 18:26:47 +00:00
Davis King f25b536996 Fixed a few more compile time errors when dlib is compiled with clang.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404123
2011-02-04 14:27:24 +00:00
Davis King d39c6e16e8 I made some minor changes in a few places so that dlib compiles with the
clang compiler.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404122
2011-02-04 14:21:48 +00:00
Davis King 7d53ed0c23 The any unit test was broken in a way which prevented it from actually running.
This has been fixed.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404121
2011-02-04 13:59:57 +00:00
Davis King c547e7bcc5 Applied a patch from Nils Labugt which fixes a bug in the gui_core component (Bug ID: 3171720).
The bug details are below:
    dlib GUI applications don't work anymore after I upgraded to Ubuntu 10.10 (AMD64). They
    consistently crash in base_window::set_title. XwcTextListToTextProperty returns
    XLocaleNotSupported instead of initializing 'property', but dlib ignores the return value,
    resulting in a crash in XLib when XSetWMName is called with garbage input or when
    property.value is XFreed without having been allocated.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404120
2011-02-03 22:45:24 +00:00