1

在进行完全连接计算之前,Caffe 如何隐式地对 blob 进行整形?

4

1 回答 1

2

"InnerProduct"layer(又名“全连接”)有一个axis:参数,它定义了 caffe 如何“扁平化”内积的 blob。
你可以看到inner_product_layer.cpp

// Dimensions starting from "axis" are "flattened" into a single
// length K_ vector. For example, if bottom[0]'s shape is (N, C, H, W),
// and axis == 1, N inner products with dimension CHW are performed.

由于 caffe 将 Blob 连续存储在内存中,因此不需要显式重塑来“展平” blob 的尾随尺寸。

于 2017-09-10T08:17:37.423 回答