From 9478a485dcdf142eca32d2a7d8231856b42c6d6c Mon Sep 17 00:00:00 2001 From: Jonathan L Long Date: Mon, 29 Sep 2014 16:49:49 -0700 Subject: [PATCH] [pycaffe] expose SGDSolver.step --- python/caffe/_caffe.cpp | 3 ++- python/caffe/_caffe.hpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/python/caffe/_caffe.cpp b/python/caffe/_caffe.cpp index f03dae3dce6..156b5187d58 100644 --- a/python/caffe/_caffe.cpp +++ b/python/caffe/_caffe.cpp @@ -197,7 +197,8 @@ BOOST_PYTHON_MODULE(_caffe) { .add_property("test_nets", &PySGDSolver::test_nets) .add_property("iter", &PySGDSolver::iter) .def("solve", &PySGDSolver::Solve) - .def("solve", &PySGDSolver::SolveResume); + .def("solve", &PySGDSolver::SolveResume) + .def("step", &PySGDSolver::Step); bp::class_ > >("NetVec") .def(bp::vector_indexing_suite >, true>()); diff --git a/python/caffe/_caffe.hpp b/python/caffe/_caffe.hpp index bf1b7d168f8..a5cef74ad66 100644 --- a/python/caffe/_caffe.hpp +++ b/python/caffe/_caffe.hpp @@ -181,6 +181,7 @@ class PySGDSolver { vector > test_nets() { return test_nets_; } int iter() { return solver_->iter(); } void Solve() { return solver_->Solve(); } + void Step(int iters) { solver_->Step(iters); } void SolveResume(const string& resume_file); protected: