SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TDistributedStochasticNeighborEmbedding.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Vladyslav S. Gorbatiuk
8  * Copyright (C) 2011-2013 Vladyslav S. Gorbatiuk
9  */
10 
12 #ifdef HAVE_EIGEN3
13 #include <shogun/lib/tapkee/tapkee_shogun.hpp>
15 
16 using namespace shogun;
17 
20 {
21  // Default values
22  m_perplexity = 30.0;
23  m_theta = 0.5;
24  init();
25 }
26 
27 void CTDistributedStochasticNeighborEmbedding::init()
28 {
29  SG_ADD(&m_perplexity, "perplexity", "perplexity", MS_NOT_AVAILABLE);
30  SG_ADD(&m_theta, "theta", "learning rate", MS_NOT_AVAILABLE);
31 }
32 
34 {
35 }
36 
38 {
39  return "TDistributedStochasticNeighborEmbedding";
40 }
41 
43 {
44 
45  m_theta = theta;
46 }
47 
49 {
50  return m_theta;
51 }
52 
54 {
55  m_perplexity = perplexity;
56 }
57 
59 {
60  return m_perplexity;
61 }
62 
64 {
65  TAPKEE_PARAMETERS_FOR_SHOGUN parameters;
66  parameters.sne_theta = m_theta;
67  parameters.sne_perplexity = m_perplexity;
68  parameters.features = (CDotFeatures*)features;
69 
70  parameters.method = SHOGUN_TDISTRIBUTED_STOCHASTIC_NEIGHBOR_EMBEDDING;
71  parameters.target_dimension = m_target_dim;
72  CDenseFeatures<float64_t>* embedding = tapkee_embed(parameters);
73  return embedding;
74 }
75 
76 #endif /* HAVE_EIGEN */

SHOGUN Machine Learning Toolbox - Documentation