35 #ifndef SHARK_MODELS_ABSTRACTMODEL_H 36 #define SHARK_MODELS_ABSTRACTMODEL_H 79 template<
class InputTypeT,
class OutputTypeT,
class ParameterType=RealVector>
88 typedef OutputType result_type;
136 throw SHARKEXCEPTION(
"[AbstractModel::createState] createState must be overridden by models with derivatives");
138 return boost::shared_ptr<State>(
new EmptyState());
162 virtual void eval(BatchInputType
const & patterns, BatchOutputType& outputs)
const{
164 eval(patterns,outputs,*state);
172 virtual void eval(BatchInputType
const & patterns, BatchOutputType& outputs,
State& state)
const = 0;
178 virtual void eval(InputType
const & pattern, OutputType& output)
const{
181 BatchOutputType outputBatch;
182 eval(patternBatch,outputBatch);
200 eval(pattern,output);
208 BatchOutputType
operator()(BatchInputType
const & patterns)
const{
209 BatchOutputType output;
210 eval(patterns,output);
221 BatchInputType
const & pattern,
222 BatchOutputType
const& outputs,
223 BatchOutputType
const & coefficients,
225 RealVector& derivative
237 BatchInputType
const & pattern,
238 BatchOutputType
const& outputs,
239 BatchOutputType
const & coefficients,
241 BatchInputType& derivative
258 BatchInputType
const & patterns,
259 BatchOutputType
const& outputs,
260 BatchOutputType
const & coefficients,
262 RealVector& parameterDerivative,
263 BatchInputType& inputDerivative
281 template <
class InputType,
class OutputType>
294 template <
class InputType,
class OutputType>
305 template<
class I,
class O,
class V>
306 struct InferShape<AbstractModel<I,O,V> >{