SHOGUN
6.0.0
src
shogun
machine
KernelStructuredOutputMachine.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) 2012 Fernando José Iglesias García
8
* Copyright (C) 2012 Fernando José Iglesias García
9
*/
10
11
#include <
shogun/machine/KernelStructuredOutputMachine.h
>
12
#include <
shogun/kernel/Kernel.h
>
13
14
using namespace
shogun
;
15
16
CKernelStructuredOutputMachine::CKernelStructuredOutputMachine
()
17
:
CStructuredOutputMachine
(), m_kernel(NULL)
18
{
19
register_parameters();
20
}
21
22
CKernelStructuredOutputMachine::CKernelStructuredOutputMachine
(
23
CStructuredModel
* model,
24
CStructuredLabels
* labs,
25
CKernel
* kernel)
26
:
CStructuredOutputMachine
(model, labs),
m_kernel
(NULL)
27
{
28
set_kernel
(kernel);
29
register_parameters();
30
}
31
32
CKernelStructuredOutputMachine::~CKernelStructuredOutputMachine
()
33
{
34
SG_UNREF
(
m_kernel
)
35
}
36
37
void
CKernelStructuredOutputMachine::set_kernel
(
CKernel
* k)
38
{
39
SG_REF
(k);
40
SG_UNREF
(
m_kernel
);
41
m_kernel
= k;
42
}
43
44
CKernel
*
CKernelStructuredOutputMachine::get_kernel
()
const
45
{
46
SG_REF
(
m_kernel
);
47
return
m_kernel
;
48
}
49
50
void
CKernelStructuredOutputMachine::register_parameters()
51
{
52
SG_ADD
((
CSGObject
**)&
m_kernel
,
"m_kernel"
,
"The kernel"
,
MS_AVAILABLE
);
53
}
shogun::CStructuredLabels
Base class of the labels used in Structured Output (SO) problems.
Definition:
StructuredLabels.h:25
KernelStructuredOutputMachine.h
Kernel.h
SG_REF
#define SG_REF(x)
Definition:
SGObject.h:52
shogun::CSGObject
Class SGObject is the base class of all shogun objects.
Definition:
SGObject.h:125
shogun::CKernelStructuredOutputMachine::~CKernelStructuredOutputMachine
virtual ~CKernelStructuredOutputMachine()
Definition:
KernelStructuredOutputMachine.cpp:32
shogun::CKernelStructuredOutputMachine::set_kernel
void set_kernel(CKernel *f)
Definition:
KernelStructuredOutputMachine.cpp:37
shogun::CKernelStructuredOutputMachine::m_kernel
CKernel * m_kernel
Definition:
KernelStructuredOutputMachine.h:65
shogun::CKernelStructuredOutputMachine::get_kernel
CKernel * get_kernel() const
Definition:
KernelStructuredOutputMachine.cpp:44
shogun::MS_AVAILABLE
Definition:
SGObject.h:103
shogun::CStructuredModel
Class CStructuredModel that represents the application specific model and contains most of the applic...
Definition:
StructuredModel.h:101
shogun::CStructuredOutputMachine
Definition:
StructuredOutputMachine.h:47
SG_UNREF
#define SG_UNREF(x)
Definition:
SGObject.h:53
shogun
all of classes and functions are contained in the shogun namespace
Definition:
class_list.h:18
shogun::CKernelStructuredOutputMachine::CKernelStructuredOutputMachine
CKernelStructuredOutputMachine()
Definition:
KernelStructuredOutputMachine.cpp:16
shogun::CKernel
The Kernel base class.
Definition:
kernel/Kernel.h:156
SG_ADD
#define SG_ADD(...)
Definition:
SGObject.h:94
SHOGUN
Machine Learning Toolbox - Documentation