From b5515bfa629cfd02875ca8d26ff4bd04f5db9b68 Mon Sep 17 00:00:00 2001 From: Ryan Birmingham Date: Mon, 11 May 2020 01:01:38 -0400 Subject: [PATCH] command and ref cleanup --- doc/guide/hpt.hpp | 10 +++++----- doc/tutorials/ann/ann.txt | 6 +++--- doc/tutorials/approx_kfn/approx_kfn.txt | 2 +- .../bindings/python/mlpack/serialization.hpp | 2 +- src/mlpack/core/tree/hollow_ball_bound.hpp | 6 +++--- src/mlpack/core/util/param.hpp | 10 +++++++--- src/mlpack/core/util/sfinae_utility.hpp | 2 -- src/mlpack/methods/ann/rbm/rbm.hpp | 18 +++++++++--------- src/mlpack/methods/lsh/lsh_search.hpp | 4 ++++ src/mlpack/methods/rann/ra_search.hpp | 2 ++ 10 files changed, 35 insertions(+), 27 deletions(-) diff --git a/doc/guide/hpt.hpp b/doc/guide/hpt.hpp index ff6bc8ffa1..e4cacbbec3 100644 --- a/doc/guide/hpt.hpp +++ b/doc/guide/hpt.hpp @@ -1,4 +1,4 @@ -namespace mlpack { +ens::namespace mlpack { namespace hpt { /*! @page hpt Hyper-Parameter Tuning @@ -32,7 +32,7 @@ The interface of the hyper-parameter tuning module is quite similar to the interface of the @ref cv "cross-validation module". To construct a \c HyperParameterTuner object you need to specify as template parameters what machine learning algorithm, cross-validation strategy, performance measure, and -optimization strategy (\ref optimization::GridSearch "GridSearch" will be used by +optimization strategy (\ref ens::GridSearch "GridSearch" will be used by default) you are going to use. Then, you must pass the same arguments as for the cross-validation classes: the data and labels (or responses) to use are given to the constructor, and the possible hyperparameter values are given to @@ -68,7 +68,7 @@ computation time. std::tie(bestLambda) = hpt.Optimize(lambdas); @endcode -In this example we have used \ref optimization::GridSearch "GridSearch" (the +In this example we have used \ref ens::GridSearch "GridSearch" (the default optimizer) to find a good value for the \c lambda hyper-parameter. For that we have specified what values should be tried. @@ -121,7 +121,7 @@ real-valued hyperparameters, but wish to further tune those values. In this case, we can use a gradient-based optimizer for hyperparameter search. In the following example, we try to optimize the \c lambda1 and \c lambda2 hyper-parameters for \ref regression::LARS "LARS" with the -\ref optimization::GradientDescent "GradientDescent" optimizer. +\ref ens::GradientDescent "GradientDescent" optimizer. @code HyperParameterTuner hpt3(validationSize, @@ -190,7 +190,7 @@ HyperParameterTuner hpt(0.2, dataset, @endcode Next, we must set up the hyperparameters to be optimized. If we are doing a -grid search with the \ref optimization::GridSearch "GridSearch" optimizer (the +grid search with the \ref ens::GridSearch "GridSearch" optimizer (the default), then we only need to pass a `std::vector` (for non-numeric hyperparameters) or an `arma::vec` (for numeric hyperparameters) containing all of the possible choices that we wish to search over. diff --git a/doc/tutorials/ann/ann.txt b/doc/tutorials/ann/ann.txt index f0913eca45..d7bc023025 100644 --- a/doc/tutorials/ann/ann.txt +++ b/doc/tutorials/ann/ann.txt @@ -419,7 +419,7 @@ not work; this example exists for its API, not its implementation. Note that layer sometimes have different properties. These properties are known at compile-time through the mlpack::ann::LayerTraits class, and some properties may imply the existence (or non-existence) of certain functions. -Refer to the LayerTraits @ref LayerTraits for more documentation on that. +Refer to the LayerTraits @ref layer_traits.hpp for more documentation on that. The two template parameters below must be template parameters to the layer, in the order given below. More template parameters are fine, but they must come @@ -661,10 +661,10 @@ $ cat model.xml @endcode -As you can see, the \c section of \c model.xml contains the trained +As you can see, the \c \ section of \c model.xml contains the trained network weights. We can see that this section also contains the network input size, which is 66 rows and 1 column. Note that in this example, we used three -different layers, as can be seen by looking at the \c section. Each +different layers, as can be seen by looking at the \c \ section. Each node has a unique id that is used to reconstruct the model when loading. The models can also be saved as \c .bin or \c .txt; the \c .xml format provides diff --git a/doc/tutorials/approx_kfn/approx_kfn.txt b/doc/tutorials/approx_kfn/approx_kfn.txt index 0542b2f6ff..be6f215ef2 100644 --- a/doc/tutorials/approx_kfn/approx_kfn.txt +++ b/doc/tutorials/approx_kfn/approx_kfn.txt @@ -87,7 +87,7 @@ In order to solve this problem, \b mlpack provides a number of interfaces. approximate furthest neighbors - a simple \ref cpp_qdafn_akfntut "C++ class for QDAFN" - a simple \ref cpp_ds_akfntut "C++ class for DrusillaSelect" - - a simple \ref cpp_kfn_akfntut "C++ class for tree-based and brute-force" + - a simple \ref cpp_ns_akfntut "C++ class for tree-based and brute-force" search @section toc_akfntut Table of Contents diff --git a/src/mlpack/bindings/python/mlpack/serialization.hpp b/src/mlpack/bindings/python/mlpack/serialization.hpp index dbb32ca05f..0ac8aa27e9 100644 --- a/src/mlpack/bindings/python/mlpack/serialization.hpp +++ b/src/mlpack/bindings/python/mlpack/serialization.hpp @@ -1,5 +1,5 @@ /** - * @serialization.hpp + * @file python/mlpack/serialization.hpp * @author Ryan Curtin * * Simple utilities for boost::serialization. diff --git a/src/mlpack/core/tree/hollow_ball_bound.hpp b/src/mlpack/core/tree/hollow_ball_bound.hpp index 72834fbff3..a7895c0616 100644 --- a/src/mlpack/core/tree/hollow_ball_bound.hpp +++ b/src/mlpack/core/tree/hollow_ball_bound.hpp @@ -124,7 +124,7 @@ class HollowBallBound /** * Determines if a point is within this bound. * - * @param point Point to check the condition. + * @param point Point to check the condition. */ template bool Contains(const VecType& point) const; @@ -145,8 +145,8 @@ class HollowBallBound void Center(VecType& center) const { center = this->center; } /** - * Calculates minimum bound-to-point squared distance - *. + * Calculates minimum bound-to-point squared distance. + * * @param point Point to which the minimum distance is requested. */ template diff --git a/src/mlpack/core/util/param.hpp b/src/mlpack/core/util/param.hpp index f06043028b..ec92d8577a 100644 --- a/src/mlpack/core/util/param.hpp +++ b/src/mlpack/core/util/param.hpp @@ -40,7 +40,7 @@ using DatasetInfo = DatasetMapper; * - A page anchor for documentation, referencing another binding by its CMake * binding name, i.e. "#knn". * - A link to a Doxygen page, using the mangled Doxygen name after a - * '@doxygen/', i.e., "@doxygen/mlpack1_1_adaboost1_1_AdaBoost". + * '\@doxygen/', i.e., "@doxygen/mlpack1_1_adaboost1_1_AdaBoost". */ #define SEE_ALSO(DESCRIPTION, LINK) {DESCRIPTION, LINK} @@ -64,7 +64,7 @@ using DatasetInfo = DatasetMapper; * care of by CLI (however, you can explicitly specify newlines to denote * new paragraphs). You can also use printing macros like * PRINT_PARAM_STRING(), PRINT_DATASET(), and others. - * @param SEE_ALSOS A set of SEE_ALSO() macros that are used for generating + * @param ... A set of SEE_ALSO() macros that are used for generating * documentation. See the SEE_ALSO() macro. This is a varargs argument, so * you can add as many SEE_ALSO()s as you like. */ @@ -820,12 +820,13 @@ using DatasetInfo = DatasetMapper; * The parameter can then be specified on the command line with * --ID=value1,value2,value3. * + * @param T Type of the parameter. * @param ID Name of the parameter. * @param DESC Quick description of the parameter (1-2 sentences). Don't use * printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others * here---it will cause problems. * @param ALIAS An alias for the parameter (one letter). - * @param DEF Default value of the parameter. + * @param T Default value of the parameter. * * @see mlpack::CLI, PROGRAM_INFO() * @@ -853,10 +854,12 @@ using DatasetInfo = DatasetMapper; * If the parameter is not set by the end of the program, a fatal runtime error * will be issued. * + * @param T Type of the parameter. * @param ID Name of the parameter. * @param DESC Quick description of the parameter (1-2 sentences). Don't use * printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others * here---it will cause problems. + * @param ALIAS An alias for the parameter (one letter). * * @see mlpack::CLI, PROGRAM_INFO() * @@ -1082,6 +1085,7 @@ using DatasetInfo = DatasetMapper; * The parameter must then be specified on the command line with * --ID=value1,value2,value3. * + * @param T Type of the parameter. * @param ID Name of the parameter. * @param DESC Quick description of the parameter (1-2 sentences). Don't use * printing macros like PRINT_PARAM_STRING() or PRINT_DATASET() or others diff --git a/src/mlpack/core/util/sfinae_utility.hpp b/src/mlpack/core/util/sfinae_utility.hpp index bbd69df72f..d080a7fdf0 100644 --- a/src/mlpack/core/util/sfinae_utility.hpp +++ b/src/mlpack/core/util/sfinae_utility.hpp @@ -248,7 +248,6 @@ struct NAME \ * * @param METHOD The name of the method to check for. * @param NAME The name of the struct to construct. - * @param MAXN The maximum number of additional arguments. */ #define HAS_METHOD_FORM(METHOD, NAME) \ HAS_METHOD_FORM_BASE(SINGLE_ARG(METHOD), SINGLE_ARG(NAME), 7) @@ -282,7 +281,6 @@ struct NAME \ * * @param METHOD The name of the method to check for. * @param NAME The name of the struct to construct. - * @param MAXN The maximum number of additional arguments. */ #define HAS_EXACT_METHOD_FORM(METHOD, NAME) \ HAS_METHOD_FORM_BASE(SINGLE_ARG(METHOD), SINGLE_ARG(NAME), 0) diff --git a/src/mlpack/methods/ann/rbm/rbm.hpp b/src/mlpack/methods/ann/rbm/rbm.hpp index fabca96338..25c022408a 100644 --- a/src/mlpack/methods/ann/rbm/rbm.hpp +++ b/src/mlpack/methods/ann/rbm/rbm.hpp @@ -194,9 +194,9 @@ class RBM /** * Sample Hidden function samples the slab outputs from the Normal * distribution with mean given by: - * $h_i*\alpha^{-1}*W_i^T*v$ + * @f$ h_i*\alpha^{-1}*W_i^T*v @f$ * and variance: - * $\alpha&{-1}$ + * @f$ \alpha&{-1} @f$ * * @param input Hidden layer of the network. * @param output The sampled visible layer. @@ -218,7 +218,7 @@ class RBM /** * The function calculates the mean of the Normal distribution of P(v|s, h). * The mean is given by: - * $\Lambda^{-1} \sum_{i=1}^N W_i * s_i * h_i$ + * @f$ \Lambda^{-1} \sum_{i=1}^N W_i * s_i * h_i @f$ * * @param input Consists of both the spike and slab variables. * @param output Mean of the of the Normal distribution. @@ -240,9 +240,9 @@ class RBM /** * The function calculates the mean of the Normal distribution of P(s|v, h). * The mean is given by: - * $h_i*\alpha^{-1}*W_i^T*v$ + * @f$ h_i*\alpha^{-1}*W_i^T*v @f$ * The variance is given by: - * $\alpha^{-1}$ + * @f$ \alpha^{-1} @f$ * * @param input Visible layer neurons. * @param output Consists of both the spike samples and slab samples. @@ -254,7 +254,7 @@ class RBM /** * The function calculates the mean of the distribution P(h|v), * where mean is given by: - * $sigm(v^T*W_i*\alpha_i^{-1}*W_i^T*v + b_i)$ + * @f$ sigm(v^T*W_i*\alpha_i^{-1}*W_i^T*v + b_i) @f$ * * @param visible The visible layer neurons. * @param spikeMean Indicates P(h|v). @@ -275,7 +275,7 @@ class RBM /** * The function calculates the mean of Normal distribution of P(s|v, h), * where the mean is given by: - * $h_i*\alpha^{-1}*W_i^T*v$ + * @f$ h_i*\alpha^{-1}*W_i^T*v @f$ * * @param visible The visible layer neurons. * @param spike The spike variables from hidden layer. @@ -288,9 +288,9 @@ class RBM /** * The function samples from the Normal distribution of P(s|v, h), * where the mean is given by: - * $h_i*\alpha^{-1}*W_i^T*v$ + * @f$ h_i*\alpha^{-1}*W_i^T*v @f$ * and variance is given by: - * $\alpha^{-1}$ + * @f$ \alpha^{-1} @f$ * * @param slabMean Mean of the Normal distribution of the slab neurons. * @param slab Sampled slab variable from the Normal distribution. diff --git a/src/mlpack/methods/lsh/lsh_search.hpp b/src/mlpack/methods/lsh/lsh_search.hpp index d906db147d..a86bc3c504 100644 --- a/src/mlpack/methods/lsh/lsh_search.hpp +++ b/src/mlpack/methods/lsh/lsh_search.hpp @@ -9,6 +9,7 @@ * * The details of this method can be found in the following paper: * + * @code * @inproceedings{datar2004locality, * title={Locality-sensitive hashing scheme based on p-stable distributions}, * author={Datar, M. and Immorlica, N. and Indyk, P. and Mirrokni, V.S.}, @@ -18,11 +19,13 @@ * year={2004}, * organization={ACM} * } + * @endcode * * Additionally, the class implements Multiprobe LSH, which improves * approximation results during the search for approximate nearest neighbors. * The Multiprobe LSH algorithm was presented in the paper: * + * @code * @inproceedings{Lv2007multiprobe, * tile={Multi-probe LSH: efficient indexing for high-dimensional similarity * search}, @@ -33,6 +36,7 @@ * year={2007}, * pages={950--961} * } + * @endcode * * * mlpack is free software; you may redistribute it and/or modify it under the diff --git a/src/mlpack/methods/rann/ra_search.hpp b/src/mlpack/methods/rann/ra_search.hpp index 2f1e58378a..969a60a220 100644 --- a/src/mlpack/methods/rann/ra_search.hpp +++ b/src/mlpack/methods/rann/ra_search.hpp @@ -7,6 +7,7 @@ * * The details of this method can be found in the following paper: * + * @code * @inproceedings{ram2009rank, * title={{Rank-Approximate Nearest Neighbor Search: Retaining Meaning and * Speed in High Dimensions}}, @@ -14,6 +15,7 @@ * booktitle={{Advances of Neural Information Processing Systems}}, * year={2009} * } + * @endcode * * mlpack is free software; you may redistribute it and/or modify it under the * terms of the 3-clause BSD license. You should have received a copy of the