-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
KernelPerceptron.cpp
60 lines (48 loc) · 1.18 KB
/
KernelPerceptron.cpp
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
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 1999-2009 Soeren Sonnenburg
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
*/
#include <shogun/classifier/KernelPerceptron.h>
#include <shogun/features/Labels.h>
#include <shogun/mathematics/Math.h>
using namespace shogun;
CKernelPerceptron::CKernelPerceptron()
: CKernelMachine()
{
}
CKernelPerceptron::~CKernelPerceptron()
{
}
bool CKernelPerceptron::train(CFeatures* data)
{
ASSERT(labels);
//CLabels* train_labels=labels->get_int_labels(num_train_labels);
//
//# compute output activation y = f(w x)
//# If y = t, don't change weights
//# If y != t, update the weights:
//
//w(new) = w(old) + 2 m t x
return false;
}
bool CKernelPerceptron::load(FILE* srcfile)
{
SG_SET_LOCALE_C;
SG_RESET_LOCALE;
return false;
}
bool CKernelPerceptron::save(FILE* dstfile)
{
SG_SET_LOCALE_C;
SG_RESET_LOCALE;
return false;
}
float64_t CKernelPerceptron::classify_example(int32_t num)
{
return 0;
}