本文整理汇总了C++中NetParameter::add_layers方法的典型用法代码示例。如果您正苦于以下问题:C++ NetParameter::add_layers方法的具体用法?C++ NetParameter::add_layers怎么用?C++ NetParameter::add_layers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetParameter
的用法示例。
在下文中一共展示了NetParameter::add_layers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// Generate inception network specifications.
int main(int argc, char** argv) {
string prefix(argv[1]);
// Deployment network spec.
string deploy_fname = prefix + "_deploy.prototxt";
NetParameter deploy;
deploy.set_name("Inception");
deploy.add_input("data");
deploy.add_input_dim(10);
deploy.add_input_dim(3);
deploy.add_input_dim(227);
deploy.add_input_dim(227);
AddBody(&deploy);
AddSoftmaxLayer("prob", "linear", deploy.add_layers());
WriteProtoToTextFile(deploy, deploy_fname);
// Training network spec.
string train_fname = prefix + "_train.prototxt";
NetParameter train;
train.set_name("Inception");
AddDataLayer("data", "label", traindb, meanfile, 64, 227, true,
train.add_layers());
AddBody(&train);
AddSoftmaxLoss("prob", "linear", "label", train.add_layers());
WriteProtoToTextFile(train, train_fname);
// Validation network spec.
string val_fname = prefix + "_val.prototxt";
NetParameter val;
val.set_name("Inception");
AddDataLayer("data", "label", valdb, meanfile, 50, 227, false,
val.add_layers());
AddBody(&val);
AddSoftmaxLayer("prob", "linear", val.add_layers());
AddAccuracyLayer("accuracy", "prob", "label", val.add_layers());
WriteProtoToTextFile(val, val_fname);
}
示例2: to_proto
void BaseProducer::to_proto (NetParameter& net) const {
*net.add_layers() = layer_param_;
}