162 SIZE_CHECK(labels.size()==predictions.size());
165 for(std::size_t i = 0; i != labels.size(); ++i){
166 SIZE_CHECK(labels[i].size()==predictions[i].size());
167 SHARK_RUNTIME_CHECK(labels[i].size() > m_ignore,
"Number of sequence elements to ignore is too large");
169 for(std::size_t j = m_ignore; j != labels[i].size(); ++j){
170 error += distanceSqr(predictions[i][j],labels[i][j]);
179 SIZE_CHECK(labels.size()==predictions.size());
180 gradient.resize(labels.size());
183 for(std::size_t i = 0; i != labels.size(); ++i){
184 SIZE_CHECK(labels[i].size()==predictions[i].size());
185 SHARK_RUNTIME_CHECK(labels[i].size() > m_ignore,
"Number of sequence elements to ignore is too large");
186 for(std::size_t j = 0; j != m_ignore; ++j){
187 gradient[i].push_back(RealVector(predictions[i][j].size(),0.0));
189 for(std::size_t j = m_ignore; j != labels[i].size(); ++j){
190 error += 0.5 * distanceSqr(predictions[i][j],labels[i][j]);
191 gradient[i].push_back(predictions[i][j] - labels[i][j]);