11 #ifndef CGRADIENTRESULT_H_ 12 #define CGRADIENTRESULT_H_ 31 m_parameter_dictionary=NULL;
44 virtual const char*
get_name()
const {
return "GradientResult"; }
57 "Provided evaluation result is not of type CGradientResult!\n")
75 REQUIRE(m_gradient,
"Gradient map should not be NULL\n")
76 REQUIRE(m_parameter_dictionary,
"Parameter dictionary should not be " 93 for (
index_t i=0; i<m_gradient->get_num_elements(); i++)
95 CMapNode<TParameter*, SGVector<float64_t> >* param_node=
96 m_gradient->get_node_ptr(i);
99 const char* param_name=param_node->key->m_name;
102 const char* object_name=
103 m_parameter_dictionary->get_element(param_node->key)->get_name();
108 SG_PRINT(
"%s.%s: ", object_name, param_name)
113 if (i==m_gradient->get_num_elements()-1)
115 if (param_gradient.
vlen>0)
120 if (param_gradient.
vlen>0)
125 SG_SPRINT(
"] Total Variables: %u\n", m_total_variables)
134 return m_total_variables;
161 REQUIRE(gradient,
"Gradient map should not be NULL\n")
169 for (
index_t i=0; i<gradient->get_num_elements(); i++)
171 CMapNode<TParameter*, SGVector<float64_t> >*
node=
172 m_gradient->get_node_ptr(i);
173 m_total_variables+=node->data.vlen;
194 SG_REF(parameter_dictionary);
196 m_parameter_dictionary=parameter_dictionary;
205 SG_REF(m_parameter_dictionary);
206 return m_parameter_dictionary;
220 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. ...
the class CMap, a map based on the hash-table. w: http://en.wikipedia.org/wiki/Hash_table ...
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()