42 template<
class InputType>
61 : Base(kernel, basis, offset, 1u)
67 {
return "MissingFeaturesKernelExpansion"; }
70 return boost::shared_ptr<State>(
new EmptyState());
74 virtual void eval(BatchInputType
const& patterns, BatchOutputType& outputs)
const{
88 for(std::size_t p = 0; p !=
batchSize(patterns); ++p){
98 for (std::size_t i = 0; i != indexedBasis.
size(); ++i){
108 void eval(BatchInputType
const& patterns, BatchOutputType& outputs,
State & state)
const{
109 eval(patterns, outputs);
118 template<
class InputTypeT>
120 const RealVector&
alpha,
121 const RealVector& scalingCoefficient,
122 InputTypeT
const& missingness
125 SIZE_CHECK(alpha.size() == scalingCoefficient.size());
129 double norm_sqr = 0.0;
135 for (std::size_t i = 0; i < alpha.size(); ++i){
136 for (std::size_t j = 0; j < alpha.size(); ++j){
143 norm_sqr += evalResult *
alpha(i) *
alpha(j) / scalingCoefficient(i) / scalingCoefficient(j);
148 return std::sqrt(norm_sqr);
152 const RealVector&
alpha,
153 const RealVector& scalingCoefficient
156 SIZE_CHECK(alpha.size() == scalingCoefficient.size());
164 double norm_sqr = 0.0;
166 for (std::size_t i = 0; i < alpha.size(); ++i){
167 for (std::size_t j = 0; j < alpha.size(); ++j){
173 norm_sqr += evalResult *
alpha(i) *
alpha(j) / scalingCoefficient(i) / scalingCoefficient(j);
178 return std::sqrt(norm_sqr);
184 for(
double v: scalingCoefficients)