本文整理汇总了C++中mat::getCols方法的典型用法代码示例。如果您正苦于以下问题:C++ mat::getCols方法的具体用法?C++ mat::getCols怎么用?C++ mat::getCols使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mat
的用法示例。
在下文中一共展示了mat::getCols方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: feedForward
void CNN::feedForward(mat& fout, const mat& fin) {
// First 1st layer of CNN MUST have only 1 input feature map
vector<mat> fins(1);
// Transpose the input feature (fin) so that rows = feature dimension, cols =
// the number of data in a single batch.
// FIXME the last column in fin is the bias needed ONLY by DNN, not by CNN.
fins[0].resize(fin.getRows(), fin.getCols() - 1);
memcpy2D(fins[0], fin, 0, 0, fin.getRows(), fin.getCols() - 1, 0, 0);
fins[0] = ~fins[0];
// FIXME SubSamplingLayer does NOT need temporary buffer.
// MAYBE just reserve those for ConvolutionalLayer.
_houts.resize(_transforms.size());
_transforms[0]->feedForward(_houts[0], fins);
for (size_t i=1; i<_transforms.size(); ++i)
_transforms[i]->feedForward(_houts[i], _houts[i-1]);
// Concatenate
fout = ~concat(_houts.back());
// Reserve one more column for bias
fout.reserve(fout.size() + fout.getRows());
fout.resize(fout.getRows(), fout.getCols() + 1);
fillLastColumnWith(fout, 1.0f);
}