Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include <shogun/machine/StructuredOutputMachine.h>
00012
00013 using namespace shogun;
00014
00015 CStructuredOutputMachine::CStructuredOutputMachine()
00016 : CMachine(), m_model(NULL), m_loss(NULL)
00017 {
00018 register_parameters();
00019 }
00020
00021 CStructuredOutputMachine::CStructuredOutputMachine(
00022 CStructuredModel* model,
00023 CLossFunction* loss,
00024 CStructuredLabels* labs)
00025 : CMachine(), m_model(model), m_loss(loss)
00026 {
00027 SG_REF(m_model);
00028 SG_REF(m_loss);
00029 set_labels(labs);
00030 register_parameters();
00031 }
00032
00033 CStructuredOutputMachine::~CStructuredOutputMachine()
00034 {
00035 SG_UNREF(m_model);
00036 SG_UNREF(m_loss);
00037 }
00038
00039 void CStructuredOutputMachine::set_model(CStructuredModel* model)
00040 {
00041 SG_UNREF(m_model);
00042 SG_REF(model);
00043 m_model = model;
00044 }
00045
00046 void CStructuredOutputMachine::set_loss(CLossFunction* loss)
00047 {
00048 SG_UNREF(m_loss);
00049 SG_REF(loss);
00050 m_loss = loss;
00051 }
00052
00053 void CStructuredOutputMachine::register_parameters()
00054 {
00055 SG_ADD((CSGObject**)&m_model, "m_model", "Structured model", MS_NOT_AVAILABLE);
00056 SG_ADD((CSGObject**)&m_loss, "m_loss", "Structured loss", MS_NOT_AVAILABLE);
00057 }