caffe学习4——net
1 The net jointly defines a function and its gradient by composition and auto-differentiation.
2 The net is a set of layers connected in a computation graph – a directed acyclic graph (DAG) to be exact.保证前向后向通路,从硬盘加载数据到返回loss,进而进行分类等任务。
3 The net is defined as a set of layers and their connections in a plaintext modeling language.网是层的集合加上连接。
例子:A simple logistic regression classifier is defined by
1 name: "LogReg" 2 layer { 3 name: "mnist" 4 type: "Data" 5 top: "data" 6 top: "label" 7 data_param { 8 source: "input_leveldb" 9 batch_size: 64 10 } 11 } 12 layer { 13 name: "ip" 14 type: "InnerProduct" 15 bottom: "data" 16 top: "ip" 17 inner_product_param { 18 num_output: 2 19 } 20 } 21 layer { 22 name: "loss" 23 type: "SoftmaxWithLoss" 24 bottom: "ip" 25 bottom: "label" 26 top: "loss" 27 }