libcrn  3.9.5
A document image processing library
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRNAffinityPropagation.h
Go to the documentation of this file.
1 /* Copyright 2015 Université Paris Descartes
2  *
3  * This file is part of libcrn.
4  *
5  * libcrn is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * libcrn is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libcrn. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * file: CRNAffinityPropagation.h
19  * \author Yann LEYDIER
20  */
21 
22 #ifndef CRNAffinityPropagation_HEADER
23 #define CRNAffinityPropagation_HEADER
24 
25 #include <vector>
26 #include <map>
27 
28 namespace crn
29 {
30  class SquareMatrixDouble;
31 
36  enum class AProClusters { MEDIUM, LOW };
37 
39  std::pair<std::vector<size_t>, std::vector<size_t>> AffinityPropagation(const SquareMatrixDouble &distance_matrix, AProClusters nclusters, double damping = 0.5, size_t stable_iters_stop = 10, size_t max_iter = 100);
41  std::pair<std::vector<size_t>, std::vector<size_t>> AffinityPropagation(const SquareMatrixDouble &distance_matrix, double preference, double damping = 0.5, size_t stable_iters_stop = 10, size_t max_iter = 100);
43  std::pair<std::vector<size_t>, std::vector<size_t>> AffinityPropagation(const SquareMatrixDouble &distance_matrix, const std::vector<double> &preference, double damping = 0.5, size_t stable_iters_stop = 10, size_t max_iter = 100);
45 }
46 
47 #endif
AProClusters
Strategies to limit the number of classes in affinity propagation.
std::pair< std::vector< size_t >, std::vector< size_t > > AffinityPropagation(const SquareMatrixDouble &distance_matrix, AProClusters nclusters, double damping=0.5, size_t stable_iters_stop=10, size_t max_iter=100)
Computes clusters and their prototypes.