35 #ifndef SHARK_MODELS_ABSTRACTMODEL_H 36 #define SHARK_MODELS_ABSTRACTMODEL_H 77 template<
class InputTypeT,
class OutputTypeT>
85 typedef OutputType result_type;
141 throw SHARKEXCEPTION(
"[AbstractModel::createState] createState must be overridden by models with derivatives");
143 return boost::shared_ptr<State>(
new EmptyState());
167 virtual void eval(BatchInputType
const & patterns, BatchOutputType& outputs)
const{
169 eval(patterns,outputs,*state);
177 virtual void eval(BatchInputType
const & patterns, BatchOutputType& outputs,
State& state)
const = 0;
183 virtual void eval(InputType
const & pattern, OutputType& output)
const{
185 get(patternBatch,0) = pattern;
186 BatchOutputType outputBatch;
187 eval(patternBatch,outputBatch);
188 output =
get(outputBatch,0);
210 eval(pattern,output);
218 BatchOutputType
operator()(BatchInputType
const & patterns)
const{
219 BatchOutputType output;
220 eval(patterns,output);
231 BatchInputType
const & pattern,
232 BatchOutputType
const & coefficients,
234 RealVector& derivative
248 BatchInputType
const & pattern,
249 BatchOutputType
const & coefficients,
252 RealVector& derivative,
265 BatchInputType
const & pattern,
266 BatchOutputType
const & coefficients,
268 BatchInputType& derivative
282 BatchInputType
const & pattern,
283 BatchOutputType
const & coefficients,
286 RealMatrix& derivative,
303 BatchInputType
const & patterns,
304 BatchOutputType
const & coefficients,
306 RealVector& parameterDerivative,
307 BatchInputType& inputDerivative
325 template <
class InputType,
class OutputType>
330 std::generate(weights.begin(), weights.end(),
gauss);
340 template <
class InputType,
class OutputType>
345 std::generate(weights.begin(), weights.end(),
uni);