提交 3e8f232e 编写于 作者: Q qiaolongfei

remove import . to enable run v2/layer.py directly

上级 14ee4b80
...@@ -22,7 +22,7 @@ import py_paddle.swig_paddle as api ...@@ -22,7 +22,7 @@ import py_paddle.swig_paddle as api
__all__ = [ __all__ = [
'optimizer', 'layer', 'activation', 'parameters', 'init', 'trainer', 'optimizer', 'layer', 'activation', 'parameters', 'init', 'trainer',
'event', 'data_type.py' 'event', 'data_type'
] ]
......
...@@ -67,7 +67,7 @@ paddle.v2.parameters.create, no longer exposed to users. ...@@ -67,7 +67,7 @@ paddle.v2.parameters.create, no longer exposed to users.
""" """
import paddle.trainer_config_helpers as conf_helps import paddle.trainer_config_helpers as conf_helps
from . import data_type as v2_data import data_type as data_type
from paddle.trainer_config_helpers.config_parser_utils import \ from paddle.trainer_config_helpers.config_parser_utils import \
parse_network_config as __parse__ parse_network_config as __parse__
from paddle.trainer_config_helpers.default_decorators import wrap_name_default from paddle.trainer_config_helpers.default_decorators import wrap_name_default
...@@ -166,7 +166,7 @@ So we also need to implement some special LayerV2. ...@@ -166,7 +166,7 @@ So we also need to implement some special LayerV2.
class DataLayerV2(Layer): class DataLayerV2(Layer):
def __init__(self, name, type, **kwargs): def __init__(self, name, type, **kwargs):
assert isinstance(type, v2_data.InputType) assert isinstance(type, data_type.InputType)
self.type = type self.type = type
self.__method_name__ = 'data_layer' self.__method_name__ = 'data_layer'
...@@ -198,8 +198,8 @@ cross_entropy_cost = __convert_to_v2__( ...@@ -198,8 +198,8 @@ cross_entropy_cost = __convert_to_v2__(
parent_names=['input', 'label']) parent_names=['input', 'label'])
if __name__ == '__main__': if __name__ == '__main__':
pixel = data(name='pixel', type=v2_data.dense_vector(784)) pixel = data(name='pixel', type=data_type.dense_vector(784))
label = data(name='label', type=v2_data.integer_value(10)) label = data(name='label', type=data_type.integer_value(10))
hidden = fc(input=pixel, size=100, act=conf_helps.SigmoidActivation()) hidden = fc(input=pixel, size=100, act=conf_helps.SigmoidActivation())
inference = fc(input=hidden, size=10, act=conf_helps.SoftmaxActivation()) inference = fc(input=hidden, size=10, act=conf_helps.SoftmaxActivation())
maxid = max_id(input=inference) maxid = max_id(input=inference)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册