提交 da0d1ba0 编写于 作者: Q qjing666

update run_with_epoch

上级 a9bcf71f
......@@ -111,6 +111,20 @@ class FedAvgTrainer(FLTrainer):
def reset(self):
self.cur_step = 0
def run_with_epoch(self,reader,feeder,fetch,num_epoch):
self._logger.debug("begin to run recv program")
self.exe.run(self._recv_program)
epoch = 0
for i in range(num_epoch):
print(epoch)
for data in reader():
self.exe.run(self._main_program,
feed=feeder.feed(data),
fetch_list=fetch)
self.cur_step += 1
epoch += 1
self._logger.debug("begin to run send program")
self.exe.run(self._send_program)
def run(self, feed, fetch):
self._logger.debug("begin to run FedAvgTrainer, cur_step=%d, inner_step=%d" %
(self.cur_step, self._step))
......
......@@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
""" PaddleFL version string """
fl_version = "0.1.1"
module_proto_version = "0.1.1"
fl_version = "0.1.2"
module_proto_version = "0.1.2"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册