From a8a25238bbde726834955db9cc9c2deeed36e33d Mon Sep 17 00:00:00 2001 From: Helin Wang Date: Wed, 1 Mar 2017 23:14:36 +0000 Subject: [PATCH] remove ITrainer interface since parameters for train is already getting out of sync. Currently there is no benefit of having a interface. --- python/paddle/v2/trainer.py | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/python/paddle/v2/trainer.py b/python/paddle/v2/trainer.py index e743a49523..6652a1e8fe 100644 --- a/python/paddle/v2/trainer.py +++ b/python/paddle/v2/trainer.py @@ -8,7 +8,7 @@ from . import event as v2_event from . import optimizer as v2_optimizer from . import parameters as v2_parameters -__all__ = ['ITrainer', 'SGD'] +__all__ = ['SGD'] def default_event_handler(event): @@ -22,26 +22,7 @@ def default_event_handler(event): pass -class ITrainer(object): - """ - The interface of Trainer. The only exposed method is `train`. - """ - - def train(self, reader, topology, parameters, event_handler=None): - """ - train method. - - :param reader: - :param topology: - :param parameters: - :param event_handler: - :return: - """ - - raise NotImplementedError() - - -class SGD(ITrainer): +class SGD(): def __init__(self, cost, parameters, update_equation): """ Simple SGD Trainer. -- GitLab