Skip to content

Commit

Permalink
Merge pull request BVLC#16 from BVLC/master
Browse files Browse the repository at this point in the history
update from updstream
  • Loading branch information
bittnt authored Jul 12, 2016
2 parents bb28dad + 61944af commit b2c12ae
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/caffe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver, layer_type_list
from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver, layer_type_list, set_random_seed
from ._caffe import __version__
from .proto.caffe_pb2 import TRAIN, TEST
from .classifier import Classifier
Expand Down
3 changes: 3 additions & 0 deletions python/caffe/_caffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const int NPY_DTYPE = NPY_FLOAT32;
void set_mode_cpu() { Caffe::set_mode(Caffe::CPU); }
void set_mode_gpu() { Caffe::set_mode(Caffe::GPU); }

void set_random_seed(unsigned int seed) { Caffe::set_random_seed(seed); }

// For convenience, check that input files can be opened, and raise an
// exception that boost will send to Python if not (caffe could still crash
// later if the input files are disturbed before they are actually used, but
Expand Down Expand Up @@ -283,6 +285,7 @@ BOOST_PYTHON_MODULE(_caffe) {
// Caffe utility functions
bp::def("set_mode_cpu", &set_mode_cpu);
bp::def("set_mode_gpu", &set_mode_gpu);
bp::def("set_random_seed", &set_random_seed);
bp::def("set_device", &Caffe::SetDevice);

bp::def("layer_type_list", &LayerRegistry<Dtype>::LayerTypeList);
Expand Down
2 changes: 1 addition & 1 deletion src/caffe/test/test_embed_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ TYPED_TEST(EmbedLayerTest, TestForwardWithBias) {
top_offset[4] = 0;
bias_offset[0] = 0;
for (int j = 0; j < kNumOutput; ++j) {
EXPECT_EQ(layer->blobs()[0]->data_at(weight_offset) +
EXPECT_FLOAT_EQ(layer->blobs()[0]->data_at(weight_offset) +
layer->blobs()[1]->data_at(bias_offset),
this->blob_top_->data_at(top_offset));
++top_offset[4];
Expand Down
5 changes: 1 addition & 4 deletions tools/extra/parse_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@

def parse_log(path_to_log):
"""Parse log file
Returns (train_dict_list, train_dict_names, test_dict_list, test_dict_names)
Returns (train_dict_list, test_dict_list)
train_dict_list and test_dict_list are lists of dicts that define the table
rows
train_dict_names and test_dict_names are ordered tuples of the column names
for the two dict_lists
"""

regex_iteration = re.compile('Iteration (\d+)')
Expand Down

0 comments on commit b2c12ae

Please sign in to comment.