-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.h
84 lines (68 loc) · 2.35 KB
/
Model.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* Open source implementation of the ML3 classifier.
*
* If you find this software useful, please cite:
*
* "Multiclass Latent Locally Linear Support Vector Machines"
* Marco Fornoni, Barbara Caputo and Francesco Orabona
* JMLR Workshop and Conference Proceedings Volume 29 (ACML 2013 Proceedings)
*
* Copyright (c) 2013 Idiap Research Institute, http://www.idiap.ch/
* Written by Marco Fornoni <marco.fornoni@idiap.ch>
*
* This file is part of the ML3 Software.
*
* ML3 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* ML3 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ML3. If not, see <http://www.gnu.org/licenses/>.
*
* Model.h
*
* Class representing a ML3 model
*
* Created on: Apr 20, 2013
* Author: Marco Fornoni
*/
#ifndef MODEL_H_
#define MODEL_H_
#include <Eigen/Dense>
#include <vector>
using namespace Eigen;
template<typename T>
class Model {
public:
// The internal representation of W
typedef Matrix< T, Dynamic, Dynamic > MatrixXT;
typedef Matrix< T, Dynamic, 1> VectorXT;
// The internal representation of W
T lambda, p, tau, trTime;
bool averaging, returnLocalBeta;
uint s, initStep, iter, maxCCCPIter, nCla, nSamp, nFeats, m, verbose;
std::vector<MatrixXT> W;
std::vector<MatrixXT> W2;
MatrixXT localBetaClass;
VectorXT totLoss;
VectorXT ael;
VectorXT loss;
VectorXT obj;
VectorXT teAcc;
static const char *fnames[23];
//Default constructor
Model();
//Default destructor
~Model();
//Main constructor
Model(std::vector<MatrixXT> _W, std::vector<MatrixXT> _W2, MatrixXT _localBetaClass, T _lambda, T _p, T _tau, uint _maxCCCPIter, T _nRep, bool _averaging, uint _initStep, uint _s0, uint _verbose, bool _returnLocalBeta);
//Main setter method
void setParams(std::vector<MatrixXT> _W, std::vector<MatrixXT> _W2, MatrixXT _localBetaClass, T _lambda, T _p, T _tau, uint _maxCCCPIter, T _nRep, bool _averaging, uint _initStep, uint _s0, uint _verbose, bool _returnLocalBeta);
};
#include "Model.tc"
#endif /* MODEL_H_ */