提交 0175386a 编写于 作者: zhaoyijin666's avatar zhaoyijin666

增加注释,修改代码格式

上级 cf928329
......@@ -52,13 +52,12 @@ def infer_user():
# load the trained model.
with gzip.open(args.model_path) as f:
parameters = paddle.parameters.Parameters.from_tar(f)
parameters.set(
'_proj_province',
np.zeros(shape=parameters.get('_proj_province').shape))
parameters.set(
'_proj_city', np.zeros(shape=parameters.get('_proj_city').shape))
parameters.set(
'_proj_phone', np.zeros(shape=parameters.get('_proj_phone').shape))
parameters.set('_proj_province', \
np.zeros(shape=parameters.get('_proj_province').shape))
parameters.set('_proj_city', \
np.zeros(shape=parameters.get('_proj_city').shape))
parameters.set('_proj_phone', \
np.zeros(shape=parameters.get('_proj_phone').shape))
parameters.set('_proj_history_clicked_items', \
np.zeros(shape= parameters.get('_proj_history_clicked_items').shape))
parameters.set('_proj_history_clicked_categories', \
......
......@@ -16,6 +16,10 @@ class DNNmodel(object):
is_infer=False):
"""
initialize model
@dnn_layer_dims: dimension of each hidden layer
@feature_dict: dictionary of encoded feature
@item_freq: dictionary of feature values and its frequency
@is_infer: if infer mode
"""
self._dnn_layer_dims = dnn_layer_dims
self._feature_dict = feature_dict
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册