SHOGUN
v2.0.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2012 Fernando José Iglesias García 00008 * Copyright (C) 2012 Fernando José Iglesias García 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 }