double evalDerivative( RealMatrix const&, RealMatrix const& prediction, RealMatrix& gradient ) const { gradient.resize(prediction.size1(),prediction.size2()); gradient.clear(); return 0; }
TestFunction(bool noisy):A(3,3),m_noisy(noisy) { A.clear(); A(0,0)=20; A(1,1)=10; A(2,2)=5; m_features|=Base::HAS_FIRST_DERIVATIVE; }
void CMACMap::eval(RealMatrix const& patterns,RealMatrix &output) const { SIZE_CHECK(patterns.size2() == m_inputSize); std::size_t numPatterns = patterns.size1(); output.resize(numPatterns,m_outputSize); output.clear(); for(std::size_t i = 0; i != numPatterns; ++i) { std::vector<std::size_t> indizes = getIndizes(row(patterns,i)); for (std::size_t o=0; o!=m_outputSize; ++o) { for (std::size_t j = 0; j != m_tilings; ++j) { output(i,o) += m_parameters(indizes[j] + o*m_parametersPerTiling); } } } }