Commit Graph

1864 Commits

Author SHA1 Message Date
Davis King 926c2afa6f Added some more tests for the max_cost_assignment() function.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404185
2011-03-23 00:32:15 +00:00
Davis King 4f46a90104 Minor change to avoid a compiler warning in gcc.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404184
2011-03-23 00:24:39 +00:00
Davis King 0e25de9c10 updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404183
2011-03-22 02:42:28 +00:00
Davis King b9a1e0c93a Added the multiclass_linear_decision_function object.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404182
2011-03-22 02:38:46 +00:00
Davis King 1e7659dc64 It occurred to me that in some cases it is very easy to end up with dense vectors
which are slightly smaller than their corresponding sparse vectors.  So I changed
the requires clause of the dot(sparse,dense) and dot(dense,sparse) functions to not
require that the dense vector's size > sparse vector's size.  Now any combination
of sizes is legal.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404181
2011-03-22 00:56:08 +00:00
Davis King 790f442b7d updated docs
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404180
2011-03-20 18:37:07 +00:00
Davis King bf43a30c23 Renamed assign_dense_to_sparse() to assign() and made it capable of also
assigning from sparse to sparse.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404179
2011-03-20 18:36:53 +00:00
Davis King f1d98591a8 Clarified spec.
--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404178
2011-03-20 18:12:48 +00:00
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