diff options
| author | Gertjan van den Burg <burg@ese.eur.nl> | 2016-10-14 19:00:33 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <burg@ese.eur.nl> | 2016-10-14 19:00:33 +0200 |
| commit | 0cc025358af341b7e9757e2b9ce5eb0b09af7b2f (patch) | |
| tree | 343f50cdba91361ddd0a18c554a7cd646d88aff8 /src | |
| parent | add sparse matrices to GenSVM and reorganize update functionality (diff) | |
| download | gensvm-0cc025358af341b7e9757e2b9ce5eb0b09af7b2f.tar.gz gensvm-0cc025358af341b7e9757e2b9ce5eb0b09af7b2f.zip | |
documentation fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/gensvm_init.c | 6 | ||||
| -rw-r--r-- | src/gensvm_kernel.c | 27 | ||||
| -rw-r--r-- | src/gensvm_pred.c | 2 | ||||
| -rw-r--r-- | src/gensvm_simplex.c | 12 | ||||
| -rw-r--r-- | src/gensvm_sv.c | 3 | ||||
| -rw-r--r-- | src/gensvm_timer.c | 2 | ||||
| -rw-r--r-- | src/gensvm_update.c | 3 |
7 files changed, 41 insertions, 14 deletions
diff --git a/src/gensvm_init.c b/src/gensvm_init.c index e0f44c1..8bee73a 100644 --- a/src/gensvm_init.c +++ b/src/gensvm_init.c @@ -27,8 +27,14 @@ * significant improvement in the number of iterations necessary * because the seeded model V is closer to the optimal V. * + * When no seed model is supplied, the rows of V are seeded with random + * numbers between the inverse of the minimum and the inverse of the maximum + * of the corresponding column of Z. This is done to center the product of the + * two in the simplex space. + * * @param[in] from_model GenModel from which to copy V * @param[in,out] to_model GenModel to which V will be copied + * @param[in] data GenData structure with the data */ void gensvm_init_V(struct GenModel *from_model, struct GenModel *to_model, struct GenData *data) diff --git a/src/gensvm_kernel.c b/src/gensvm_kernel.c index 97328d2..67c063d 100644 --- a/src/gensvm_kernel.c +++ b/src/gensvm_kernel.c @@ -98,6 +98,21 @@ void gensvm_kernel_postprocess(struct GenModel *model, free(K2); } +/** + * @brief Compute the kernel matrix + * + * @details + * This function computes the kernel matrix of a data matrix based on the + * requested kernel type and the kernel parameters. The potential types of + * kernel functions are document in KernelType. This function uses a naive + * multiplication and computes the entire upper triangle of the kernel matrix, + * then copies this over to the lower triangle. + * + * @param[in] model a GenModel structure with the model + * @param[in] data a GenData structure with the data + * @param[out] K an nxn preallocated kernel matrix + * + */ void gensvm_make_kernel(struct GenModel *model, struct GenData *data, double *K) { @@ -132,11 +147,17 @@ void gensvm_make_kernel(struct GenModel *model, struct GenData *data, } /** - * @brief Find the (reduced) eigendecomposition of a kernel matrix. + * @brief Find the (reduced) eigendecomposition of a kernel matrix + * + * @todo + * Document this function * - * @details. - * tbd + * @param[in] K + * @param[in] n + * @param[out] P + * @param[out] Sigma * + * @return */ long gensvm_make_eigen(double *K, long n, double **P, double **Sigma) { diff --git a/src/gensvm_pred.c b/src/gensvm_pred.c index 1feb14a..afa1ab9 100644 --- a/src/gensvm_pred.c +++ b/src/gensvm_pred.c @@ -23,7 +23,7 @@ * norm. The nearest simplex vertex determines the predicted class label, * which is recorded in predy. * - * @param[in] data GenData to predict labels for + * @param[in] testdata GenData to predict labels for * @param[in] model GenModel with optimized V * @param[out] predy pre-allocated vector to record predictions in */ diff --git a/src/gensvm_simplex.c b/src/gensvm_simplex.c index a704d85..1a853cc 100644 --- a/src/gensvm_simplex.c +++ b/src/gensvm_simplex.c @@ -16,14 +16,12 @@ * @brief Generate matrix of simplex vertex coordinates * * @details - * Generate the simplex matrix. Each row of the created - * matrix contains the coordinate vector of a single - * vertex of the K-simplex in K-1 dimensions. The simplex - * generated is a special simplex with edges of length 1. - * The simplex matrix U must already have been allocated. + * Generate the simplex matrix. Each row of the created matrix contains the + * coordinate vector of a single vertex of the K-simplex in K-1 dimensions. + * The simplex generated is a special simplex with edges of length 1. The + * simplex matrix U of the GenModel must already have been allocated. * - * @param[in] K number of classes - * @param[in,out] U simplex matrix of size K * (K-1) + * @param[in,out] model a GenModel structure */ void gensvm_simplex(struct GenModel *model) { diff --git a/src/gensvm_sv.c b/src/gensvm_sv.c index abfb871..bb5c48c 100644 --- a/src/gensvm_sv.c +++ b/src/gensvm_sv.c @@ -21,8 +21,7 @@ * other classes). All objects for which this is not the case are thus support * vectors. * - * @param[in] model GenModel with solution - * @param[in] data GenData to be used + * @param[in] model GenModel with solution and up-to-date Q matrix * @return number of support vectors with this solution * */ diff --git a/src/gensvm_timer.c b/src/gensvm_timer.c index 0e020fe..18bcad6 100644 --- a/src/gensvm_timer.c +++ b/src/gensvm_timer.c @@ -15,7 +15,7 @@ /** * @brief Calculate the time between two time recordings * - * @detail + * @details * This function should be used with time recordings done by clock_gettime() * using CLOCK_MONOTONIC_RAW. For this, the Timer() macro has been defined in * the header file. Example usage: diff --git a/src/gensvm_update.c b/src/gensvm_update.c index 289f50c..59ce3a8 100644 --- a/src/gensvm_update.c +++ b/src/gensvm_update.c @@ -38,6 +38,7 @@ * GenModel::R to speed up the computation. * * @param[in] model GenModel structure with the current model + * @param[in] data GenData structure with the data (used for y) * @param[in] i index of the instance for which to calculate omega * @returns the value of omega for instance i * @@ -70,6 +71,7 @@ double gensvm_calculate_omega(struct GenModel *model, struct GenData *data, * check if strictly less than 2 are nonzero. See also the @ref update_math. * * @param[in] model GenModel structure with the current model + * @param[in] data GenData structure with the data (used for y) * @param[in] i index of the instance for which to check * @returns whether or not we can do simple majorization * @@ -206,6 +208,7 @@ void gensvm_calculate_ab_simple(struct GenModel *model, long i, long j, * returned. * * @param[in] model GenModel structure with the current model + * @param[in] data GenData structure with the data * @param[in] i index of the instance to update * @param[out] beta beta vector of linear coefficients (assumed to * be allocated elsewhere, initialized here) |
