namespace caffe {
+bool UpgradeV0Net(const V0NetParameter& v0_net_param, NetParameter* net_param);
+
bool UpgradeV0LayerConnection(const V0LayerConnection& v0_layer_connection,
LayerParameter* layer_param);
package caffe;
+message V0NetParameter {
+ optional string name = 1; // consider giving the network a name
+ repeated V0LayerConnection layers = 2; // a bunch of layers.
+ // The input blobs to the network.
+ repeated string input = 3;
+ // The dim of the input blobs. 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;
+ // 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];
+}
+
message V0LayerParameter {
optional string name = 1; // the layer name
optional string type = 2; // the string to specify the layer type
namespace caffe {
+bool UpgradeV0Net(const V0NetParameter& v0_net_param,
+ NetParameter* net_param) {
+ bool full_compatibility = true;
+ net_param->Clear();
+ if (v0_net_param.has_name()) {
+ net_param->set_name(v0_net_param.name());
+ }
+ for (int i = 0; i < v0_net_param.layers_size(); ++i) {
+ full_compatibility &= UpgradeV0LayerConnection(v0_net_param.layers(i),
+ net_param->add_layers());
+ }
+}
+
bool UpgradeV0LayerConnection(const V0LayerConnection& v0_layer_connection,
LayerParameter* layer_param) {
bool full_compatibility = true;