11 #ifndef CGRADIENTRESULT_H_
12 #define CGRADIENTRESULT_H_
34 m_parameter_dictionary=NULL;
47 virtual const char*
get_name()
const {
return "GradientResult"; }
60 "Provided evaluation result is not of type CGradientResult!\n")
78 REQUIRE(m_gradient,
"Gradient map should not be NULL\n")
79 REQUIRE(m_parameter_dictionary,
"Parameter dictionary should not be "
96 for (
index_t i=0; i<m_gradient->get_num_elements(); i++)
98 CMapNode<TParameter*, SGVector<float64_t> >* param_node=
99 m_gradient->get_node_ptr(i);
102 const char* param_name=param_node->key->m_name;
105 const char* object_name=
106 m_parameter_dictionary->get_element(param_node->key)->get_name();
111 SG_PRINT(
"%s.%s: ", object_name, param_name)
116 if (i==m_gradient->get_num_elements()-1)
118 if (param_gradient.
vlen>0)
123 if (param_gradient.
vlen>0)
128 SG_SPRINT(
"] Total Variables: %u\n", m_total_variables)
137 return m_total_variables;
164 REQUIRE(gradient,
"Gradient map should not be NULL\n")
172 for (
index_t i=0; i<gradient->get_num_elements(); i++)
174 CMapNode<TParameter*, SGVector<float64_t> >*
node=
175 m_gradient->get_node_ptr(i);
176 m_total_variables+=node->data.vlen;
197 SG_REF(parameter_dictionary);
199 m_parameter_dictionary=parameter_dictionary;
208 SG_REF(m_parameter_dictionary);
209 return m_parameter_dictionary;
223 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 ...