11 #ifndef CGRADIENTRESULT_H_
12 #define CGRADIENTRESULT_H_
33 m_parameter_dictionary=NULL;
46 virtual const char*
get_name()
const {
return "GradientResult"; }
59 "Provided evaluation result is not of type CGradientResult!\n")
77 REQUIRE(m_gradient,
"Gradient map should not be NULL\n")
78 REQUIRE(m_parameter_dictionary,
"Parameter dictionary should not be "
95 for (
index_t i=0; i<m_gradient->get_num_elements(); i++)
97 CMapNode<TParameter*, SGVector<float64_t> >* param_node=
98 m_gradient->get_node_ptr(i);
101 const char* param_name=param_node->key->m_name;
104 const char* object_name=
105 m_parameter_dictionary->get_element(param_node->key)->get_name();
110 SG_PRINT(
"%s.%s: ", object_name, param_name)
115 if (i==m_gradient->get_num_elements()-1)
117 if (param_gradient.
vlen>0)
122 if (param_gradient.
vlen>0)
127 SG_SPRINT(
"] Total Variables: %u\n", m_total_variables)
136 return m_total_variables;
163 REQUIRE(gradient,
"Gradient map should not be NULL\n")
171 for (
index_t i=0; i<gradient->get_num_elements(); i++)
173 CMapNode<TParameter*, SGVector<float64_t> >*
node=
174 m_gradient->get_node_ptr(i);
175 m_total_variables+=node->data.vlen;
196 SG_REF(parameter_dictionary);
198 m_parameter_dictionary=parameter_dictionary;
207 SG_REF(m_parameter_dictionary);
208 return m_parameter_dictionary;
222 uint32_t m_total_variables;
virtual void set_value(SGVector< float64_t > value)
virtual EEvaluationResultType get_result_type() const
virtual void set_gradient(CMap< TParameter *, SGVector< float64_t > > *gradient)
virtual void print_result()
virtual void set_paramter_dictionary(CMap< TParameter *, CSGObject * > *parameter_dictionary)
static CGradientResult * obtain_from_generic(CEvaluationResult *eval_result)
virtual uint32_t get_total_variables()
virtual CMap< TParameter *, CSGObject * > * get_paramter_dictionary()
Abstract class that contains the result generated by the MachineEvaluation class. ...
virtual CMap< TParameter *, SGVector< float64_t > > * get_gradient()
virtual const char * get_name() const
all of classes and functions are contained in the shogun namespace
Container class that returns results from GradientEvaluation. It contains the function value as well ...
virtual SGVector< float64_t > get_value()
virtual EEvaluationResultType get_result_type() const =0
virtual ~CGradientResult()
the class CMap, a map based on the hash-table. w: http://en.wikipedia.org/wiki/Hash_table ...