Net由多个layer组成,是一个有向无环图(DAG)。
Net参数主要包括网络信息和每个layer的信息,Blob信息等,接口包括初始化Net来构建整个图,Net信息接口,初始化后Bolb数据输入等。
src/caffe/proto/caffe.proto
message NetParameter {
optional string name = 1; // 网络名称
// DEPRECATED. See InputParameter. The input blobs to the network.
repeated string input = 3; //网络输入的blob名称
// DEPRECATED. See InputParameter. The shape of the input blobs.
repeated BlobShape input_shape = 8; //输入blob维度
// 4D input dimensions -- deprecated. Use "input_shape" instead.
// If specified, for each input blob there should be four
// values specifying the num, channels, height and width of the input blob.
// Thus, there should be a total of (4 * #input) numbers.
repeated int32 input_dim = 4; //默认维度4,代表num, channels, height and width of the input blob
// Whether the network will force every layer to carry out backward operation.
// If set False, then whether to carry out backward is determined
// automatically according to the net structure and learning rates.
optional bool force_backward = 5 [default = false]; //是否强制每个层执行后向传播
// The current "state" of the network, including the phase, level, and stage.
// Some layers may be included/excluded depending on this state and the states
// specified in the layers' include and exclude fields.
optional NetState state = 6; //网络当前状态
// Print debugging information about results while running Net::Forward,
// Net::Backward, and Net::Update.
optional bool debug_info = 7 [default = false];