Commit Graph

1856 Commits

Author SHA1 Message Date
Davis King 02ec16db94 Added a dot() function which can dot a sparse vector with a dense vector.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404177
2011-03-20 14:13:32 +00:00
Davis King 57aed828d4 updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404176
2011-03-18 18:43:10 +00:00
Davis King aed73cd057 This change is mainly about adding a result_type typedef to the various function objects.
Prior to this change, different function objects declared their return type in different ways,
now this has all been reconciled.  Now they all declare it as a public typedef named result_type.

I also simplified the cross_validate_multiclass_trainer(), cross_validate_trainer(),
test_binary_decision_function(), and test_multiclass_decision_function().  They now always
return double matrices regardless of any other consideration.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404175
2011-03-18 18:42:53 +00:00
Davis King 7e934b9de1 Added some tests for the LIBSVM formatted data IO functions
and related routines.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404174
2011-03-18 14:35:35 +00:00
Davis King 4427c91ab4 updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404173
2011-03-18 13:42:31 +00:00
Davis King a6b8cc9b7f Added the fix_nonzero_indexing() function.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404172
2011-03-18 13:31:52 +00:00
Davis King ae79b13a07 made test more robust
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404171
2011-03-16 23:42:57 +00:00
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