MCPcopy Create free account
hub / github.com/davisking/dlib / model

Function model

examples/least_squares_ex.cpp:31–46  ·  view source on GitHub ↗

We will use this function to generate data. It represents a function of 2 variables and 3 parameters. The least squares procedure will be used to infer the values of the 3 parameters based on a set of input/output pairs.

Source from the content-addressed store, hash-verified

29// and 3 parameters. The least squares procedure will be used to infer the values of
30// the 3 parameters based on a set of input/output pairs.
31double model (
32 const input_vector& input,
33 const parameter_vector& params
34)
35{
36 const double p0 = params(0);
37 const double p1 = params(1);
38 const double p2 = params(2);
39
40 const double i0 = input(0);
41 const double i1 = input(1);
42
43 const double temp = p0*i0 + p1*i1 + p2;
44
45 return temp*temp;
46}
47
48// ----------------------------------------------------------------------------------------
49

Callers 5

find_min_trust_regionFunction · 0.85
operator()Method · 0.85
residualFunction · 0.85
mainFunction · 0.85

Calls 1

inputClass · 0.50

Tested by

no test coverage detected