| 95 | } |
| 96 | |
| 97 | void project(const Template &src, Template &dst) const |
| 98 | { |
| 99 | dst = src; |
| 100 | |
| 101 | // See above for response dimensionality |
| 102 | Mat response(outputVariables.size(), 1, CV_32FC1); |
| 103 | mlp.predict(src.m().reshape(1,1),response); |
| 104 | |
| 105 | // Apparently mlp.predict reshapes the response matrix? |
| 106 | for (int i=0; i<outputVariables.size(); i++) dst.file.set(outputVariables.at(i),response.at<float>(0,i)); |
| 107 | } |
| 108 | |
| 109 | void load(QDataStream &stream) |
| 110 | { |