Skip to content

Commit

Permalink
Merge pull request BVLC#4 from Russell91/name_changes
Browse files Browse the repository at this point in the history
added f() methods in c++, including a new one that takes a string prototxt
  • Loading branch information
Russell Stewart authored and Russell Stewart committed Aug 21, 2015
2 parents 1239e65 + 173c605 commit 1f62afa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/caffe/apollonet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class ApolloNet {

Dtype ForwardLayer(const string& layer_param_string);

Dtype ForwardLayer(shared_ptr<Layer<Dtype> > layer);
Dtype f(shared_ptr<Layer<Dtype> > layer);

Dtype f(const string& layer_prototxt);

void BackwardLayer(const string& layer_name);

Expand Down
10 changes: 9 additions & 1 deletion src/caffe/apollonet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ template <typename Dtype>
ApolloNet<Dtype>::ApolloNet() {
Init();
}

template <typename Dtype>
Dtype ApolloNet<Dtype>::f(const string& layer_prototxt) {
shared_ptr<Layer<Dtype> > layer =
LayerRegistry<Dtype>::CreateLayer(layer_prototxt);
return f(layer);
}

template <typename Dtype>
Dtype ApolloNet<Dtype>::ForwardLayer(shared_ptr<Layer<Dtype> > layer) {
Dtype ApolloNet<Dtype>::f(shared_ptr<Layer<Dtype> > layer) {
/* This function will
* 1) Add the layer to the cache if it's new
* 2) Set up the top blobs
Expand Down

0 comments on commit 1f62afa

Please sign in to comment.