提交 a8a25238 编写于 作者: H Helin Wang

remove ITrainer interface since parameters for train is already getting out of...

remove ITrainer interface since parameters for train is already getting out of sync. Currently there is no benefit of having a interface.
上级 1013983e
...@@ -8,7 +8,7 @@ from . import event as v2_event ...@@ -8,7 +8,7 @@ from . import event as v2_event
from . import optimizer as v2_optimizer from . import optimizer as v2_optimizer
from . import parameters as v2_parameters from . import parameters as v2_parameters
__all__ = ['ITrainer', 'SGD'] __all__ = ['SGD']
def default_event_handler(event): def default_event_handler(event):
...@@ -22,26 +22,7 @@ def default_event_handler(event): ...@@ -22,26 +22,7 @@ def default_event_handler(event):
pass pass
class ITrainer(object): class SGD():
"""
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):
def __init__(self, cost, parameters, update_equation): def __init__(self, cost, parameters, update_equation):
""" """
Simple SGD Trainer. Simple SGD Trainer.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册