From aeb0e984a168030769c107e278d223cae5f8c0ea Mon Sep 17 00:00:00 2001 From: Karen Simonyan Date: Sun, 21 Sep 2014 17:58:41 +0100 Subject: [PATCH] added support for "k" LRN parameter to upgrade_proto --- src/caffe/proto/caffe.proto | 1 + src/caffe/util/upgrade_proto.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/caffe/proto/caffe.proto b/src/caffe/proto/caffe.proto index b9712fa..01a516e 100644 --- a/src/caffe/proto/caffe.proto +++ b/src/caffe/proto/caffe.proto @@ -716,6 +716,7 @@ message V0LayerParameter { optional uint32 local_size = 13 [default = 5]; // for local response norm optional float alpha = 14 [default = 1.]; // for local response norm optional float beta = 15 [default = 0.75]; // for local response norm + optional float k = 22 [default = 1.]; // For data layers, specify the data source optional string source = 16; diff --git a/src/caffe/util/upgrade_proto.cpp b/src/caffe/util/upgrade_proto.cpp index c69c58e..cbd6003 100644 --- a/src/caffe/util/upgrade_proto.cpp +++ b/src/caffe/util/upgrade_proto.cpp @@ -285,6 +285,14 @@ bool UpgradeLayerParameter(const LayerParameter& v0_layer_connection, is_fully_compatible = false; } } + if (v0_layer_param.has_k()) { + if (type == "lrn") { + layer_param->mutable_lrn_param()->set_k(v0_layer_param.k()); + } else { + LOG(ERROR) << "Unknown parameter k for layer type " << type; + is_fully_compatible = false; + } + } if (v0_layer_param.has_source()) { if (type == "data") { layer_param->mutable_data_param()->set_source(v0_layer_param.source()); -- 2.7.4