56 for (int32_t i=0; i<length; i++)
72 for (int32_t j=0; j<num_inputs; j++)
73 sum_j += W(i,j)*W(i,j);
78 contraction_term += h_*h_*sum_j;
99 for (int32_t j=0; j<num_inputs; j++)
105 float64_t g = 2*w*(h-1)*h*(h*(2*w*h_-1)-w*h_+h*h);
120 for (int32_t i=0; i<length; i++)
virtual float64_t compute_contraction_term(SGVector< float64_t > parameters)
SGVector< int32_t > m_input_sizes
virtual void compute_contraction_term_gradients(SGVector< float64_t > parameters, SGVector< float64_t > gradients)
SGMatrix< float64_t > m_activations
virtual void compute_activations(SGVector< float64_t > parameters, CDynamicObjectArray *layers)
SGMatrix< float64_t > m_local_gradients
virtual void compute_local_gradients(SGMatrix< float64_t > targets)
static T sum(T *vec, int32_t len)
Return sum(vec)
Dynamic array class for CSGObject pointers that creates an array that can be used like a list or an a...
Neural layer with linear neurons, with an identity activation function. can be used as a hidden layer...
virtual void compute_activations(SGVector< float64_t > parameters, CDynamicObjectArray *layers)
all of classes and functions are contained in the shogun namespace
static float64_t exp(float64_t x)
virtual void compute_local_gradients(SGMatrix< float64_t > targets)
float64_t contraction_coefficient