提交 3fa7150c 编写于 作者: X xiexionghang

support weightAdjust by show

上级 88dd55e9
......@@ -66,7 +66,6 @@ int32_t DenseInputAccessor::pull_dense(size_t table_id) {
auto* ps_client = _trainer_context->pslib->ps_client();
auto push_status = ps_client->pull_dense(regions.data(), regions.size(), table_id);
int32_t ret = push_status.get();
// TODO 使用双buffer DataBuffer,避免训练期改写,当前异步SGD下,问题不大
switch_data_buffer();
_is_data_buffer_init = true;
return ret;
......@@ -95,7 +94,7 @@ int32_t DenseInputAccessor::collect_persistables(paddle::framework::Scope* scope
pull_dense(_table_id);
_pull_request_num = 0;
} else {
usleep(50000);
usleep(10000);
}
}
});
......
......@@ -76,19 +76,20 @@ protected:
};
struct SparseInputVariable {
size_t slot_dim;
size_t total_dim;
std::string name;
std::string gradient_name;
std::vector<int32_t> slot_idx;
std::vector<uint16_t> slot_list;
size_t slot_dim; // slot下dim数
size_t total_dim; // slot_dim * slot_num
std::string name; // 对应参数变量名称
std::string gradient_name; // 对应梯度变量名称
std::vector<int32_t> slot_idx; // 通过slot_id 反查 slot在参数层的idx
std::vector<uint16_t> slot_list; // slot_id列表
};
struct SparseVarRuntimeData {
uint32_t row_size;
uint32_t total_size;
float* variable_data;
float* gradient_data;
uint32_t row_size; // batch_size
uint32_t total_size; // batch_size * input_dim
float* variable_data; // 参数
float* gradient_data; // 梯度
SparseInputVariable* sparse_var_metas; // metas
};
class BaseSparseInputAccessor : public DataInputAccessor {
......@@ -102,15 +103,18 @@ public:
// forword过程的input填充
virtual int32_t forward(SampleInstance* samples, size_t num,
paddle::framework::Scope* scope);
// 取得单个SparseKey的PullValue, 实现单个SparseValue的填充
virtual void fill_input(float* var_data, const float* pull_raw,
paddle::ps::ValueAccessor&, SparseInputVariable&, SampleInstance&) = 0;
// 所有SparseValue填充完成后,调用,可进一步全局处理
virtual void post_process_input(float* var_data, SparseInputVariable&, SampleInstance*, size_t num) = 0;
// backward过程的梯度push
virtual std::future<int32_t> backward(SampleInstance* samples, size_t num,
paddle::framework::Scope* scope);
// SparseGradValue会被依次调用,用于整理push的梯度
virtual void fill_gradient(float* push_value, const float* gradient_raw,
paddle::ps::ValueAccessor&, SparseInputVariable&,
......
......@@ -77,6 +77,7 @@ int32_t BaseSparseInputAccessor::forward(SampleInstance* samples,
const auto& variable = _x_variables[i];
var_runtime_data[i].row_size = num;
var_runtime_data[i].total_size = num * variable.total_dim;
var_runtime_data[i].sparse_var_metas = &(_x_variables[i]);
auto* tensor = ScopeHelper::resize_lod_tensor(
scope, variable.name, {num, variable.total_dim});
auto* grad_tensor = ScopeHelper::resize_lod_tensor(
......
#include "paddle/fluid/train/custom_trainer/feed/accessor/input_data_accessor.h"
namespace paddle {
namespace custom_trainer {
namespace feed {
class WeightsAdjustAccessor : public DataInputAccessor {
public:
WeightsAdjustAccessor() {}
virtual ~WeightsAdjustAccessor() {}
virtual int initialize(YAML::Node config,
std::shared_ptr<TrainerContext> context_ptr) {
_trainer_context = context_ptr.get();
_slot_id = config["slot_id"].as<int>();
_input_name = config["input"].as<std::string>();
_adjw_ratio = config["adjw_ratio"].as<float>();
_adjw_threshold = config["adjw_threshold"].as<float>();
return 0;
}
virtual int32_t forward(SampleInstance* samples, size_t num,
::paddle::framework::Scope* scope) {
int64_t runtime_data_for_scope = *ScopeHelper::get_value<int64_t>(
scope, _trainer_context->cpu_place, "sparse_runtime_data");
auto* runtime_data_ptr = (std::vector<SparseVarRuntimeData>*)runtime_data_for_scope;
auto& var_runtime_data = *runtime_data_ptr;
int slot_idx = -1;
SparseVarRuntimeData* sparse_var_data = nullptr;
for (auto& sparse_var : var_runtime_data) {
slot_idx = sparse_var.sparse_var_metas->slot_idx[_slot_id];
if (slot_idx >= 0) {
sparse_var_data = &sparse_var;
break;
}
}
CHECK(slot_idx >= 0) << "Not Found this Slot in slot_list. slot_id:" << _slot_id;
auto* tensor = ScopeHelper::resize_lod_tensor(scope, _input_name, {num, 1});
auto* weights_data = tensor->mutable_data<float>(_trainer_context->cpu_place);
float* sparse_input_data = sparse_var_data->variable_data;
size_t sparse_slot_dim = sparse_var_data->sparse_var_metas->slot_dim;
size_t sparse_input_col = sparse_var_data->sparse_var_metas->total_dim;
for (int i = 0; i < num; ++i) {
float show = sparse_input_data[i * sparse_input_col + slot_idx * sparse_slot_dim];
show = pow(M_E, show) - 1; // show在fill时算过log,这里恢复原值
weights_data[i] = 1.0;
if (show >= 0 && show < _adjw_threshold) {
weights_data[i] = log(M_E + (_adjw_threshold - show) / _adjw_threshold * _adjw_ratio);
}
}
return 0;
}
virtual std::future<int32_t> backward(SampleInstance* samples, size_t num,
::paddle::framework::Scope* scope) {
std::future<int32_t> ret;
return ret;
}
protected:
size_t _slot_id;
float _adjw_ratio;
float _adjw_threshold;
std::string _input_name;
};
REGIST_CLASS(DataInputAccessor, WeightsAdjustAccessor);
} // namespace feed
} // namespace custom_trainer
} // namespace paddle
......@@ -55,7 +55,9 @@ def inference():
{ "class": "AbacusSparseJoinAccessor", "input": "sparses", "table_id": 0, "need_gradient": False},
{ "class": "DenseInputAccessor", "input": "vars", "table_id": 1, "need_gradient": True, "async_pull": True},
{ "class": "DenseInputAccessor", "input": "sums", "table_id": 2, "need_gradient": True, "async_pull": True},
{ "class": "WeightsAdjustAccessor", "input": "ins_weight", "slot_id": 6002, "adjw_ratio": 20, "adjw_threshold": 1000 },
{ "class": "LabelInputAccessor", "input": "labels"}
]
monitors = [
{ "name": "epoch_auc", "class": "AucMonitor", "target": ctr_output, "compute_interval": 600 },
......@@ -81,9 +83,17 @@ def loss_function(ctr_output):
list<Variable>: labels
"""
# TODO: calc loss here
ins_weight = fluid.layers.data(
name="ins_weight",
shape=[-1, 1],
dtype="float32",
lod_level=0,
append_batch_size=False,
stop_gradient=True)
label = fluid.layers.data(name='label_ctr', shape=ctr_output.shape, dtype='float32')
loss = fluid.layers.log_loss(input=ctr_output, label=label)
loss = fluid.layers.elementwise_mul(loss, ins_weight)
loss = fluid.layers.mean(loss, name='loss_ctr')
return loss, [label]
......@@ -87,6 +87,8 @@ input_accessor:
shape: [4488]
need_gradient: true
table_id: 2
- {adjw_ratio: 20, adjw_threshold: 1000, class: WeightsAdjustAccessor, input: ins_weight,
slot_id: 6002}
- class: LabelInputAccessor
input:
- label_name: label_ctr
......
......@@ -277,8 +277,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -341,8 +341,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -407,8 +407,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -471,8 +471,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -537,8 +537,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -601,8 +601,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -667,8 +667,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -731,8 +731,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -797,8 +797,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -861,8 +861,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -927,8 +927,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -991,8 +991,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1057,8 +1057,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1121,8 +1121,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1187,8 +1187,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1251,8 +1251,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"join.py\", line 51, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1316,8 +1316,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 3456, in data_norm\n dtype=input.dtype)\n"
strings: " File \"join.py\", line 31, in inference\n param_attr={\"batch_size\":1e4, \"batch_sum_default\":0.0, \"batch_square\":1e4})\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1370,8 +1370,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 3448, in data_norm\n dtype=input.dtype)\n"
strings: " File \"join.py\", line 31, in inference\n param_attr={\"batch_size\":1e4, \"batch_sum_default\":0.0, \"batch_square\":1e4})\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1424,8 +1424,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 3440, in data_norm\n dtype=input.dtype)\n"
strings: " File \"join.py\", line 31, in inference\n param_attr={\"batch_size\":1e4, \"batch_sum_default\":0.0, \"batch_square\":1e4})\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......
......@@ -67,7 +67,9 @@ input_accessor:
- name: fc_5.b_0
shape: [1]
need_gradient: true
table_id: 3
table_id: 5
- {adjw_ratio: 20, adjw_threshold: 1000, class: WeightsAdjustAccessor, input: ins_weight,
slot_id: 6002}
- class: LabelInputAccessor
input:
- label_name: label_ctr
......
......@@ -184,8 +184,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -248,8 +248,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -314,8 +314,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -378,8 +378,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -444,8 +444,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -508,8 +508,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -574,8 +574,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -638,8 +638,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -704,8 +704,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -768,8 +768,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -834,8 +834,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -898,8 +898,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 337, in fc\n attr=param_attr, shape=param_shape, dtype=dtype, is_bias=False)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......
......@@ -514,8 +514,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 345, in fc\n \"y_num_col_dims\": 1})\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "use_mkldnn"
......@@ -580,8 +580,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -637,8 +637,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 360, in fc\n return helper.append_activation(pre_activation)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -702,8 +702,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 345, in fc\n \"y_num_col_dims\": 1})\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "use_mkldnn"
......@@ -768,8 +768,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -825,8 +825,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 360, in fc\n return helper.append_activation(pre_activation)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -890,8 +890,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 345, in fc\n \"y_num_col_dims\": 1})\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "use_mkldnn"
......@@ -956,8 +956,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1013,8 +1013,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 360, in fc\n return helper.append_activation(pre_activation)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1078,8 +1078,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 345, in fc\n \"y_num_col_dims\": 1})\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "use_mkldnn"
......@@ -1144,8 +1144,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1201,8 +1201,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 360, in fc\n return helper.append_activation(pre_activation)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1266,8 +1266,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 345, in fc\n \"y_num_col_dims\": 1})\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "use_mkldnn"
......@@ -1332,8 +1332,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1389,8 +1389,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 360, in fc\n return helper.append_activation(pre_activation)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1454,8 +1454,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 345, in fc\n \"y_num_col_dims\": 1})\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "use_mkldnn"
......@@ -1520,8 +1520,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 358, in fc\n pre_activation = helper.append_bias_op(pre_bias, dim_start=num_flatten_dims)\n"
strings: " File \"update.py\", line 47, in inference\n initializer=fluid.initializer.NormalInitializer(loc=0.0, scale=1.0 * scales[i])))\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1561,8 +1561,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/nn.py\", line 10681, in clip\n outputs={\"Out\": out})\n"
strings: " File \"update.py\", line 49, in inference\n ctr_output = fluid.layers.sigmoid(fluid.layers.clip(net, min=-15.0, max=15.0), name=\"ctr\")\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......@@ -1622,8 +1622,8 @@ blocks {
strings: " File \"/home/xiexionghang/paddle/py-paddle/python/lib/python2.7/site-packages/paddle/fluid/layers/layer_function_generator.py\", line 247, in func\n helper.append_op(type=op_type, inputs={\"X\": x}, outputs={\"Out\": output})\n"
strings: " File \"update.py\", line 49, in inference\n ctr_output = fluid.layers.sigmoid(fluid.layers.clip(net, min=-15.0, max=15.0), name=\"ctr\")\n"
strings: " File \"create_programs.py\", line 100, in build_and_save\n inference_info = self._inference()\n"
strings: " File \"create_programs.py\", line 187, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 190, in <module>\n main(sys.argv)\n"
strings: " File \"create_programs.py\", line 200, in main\n builder.build_and_save()\n"
strings: " File \"create_programs.py\", line 203, in <module>\n main(sys.argv)\n"
}
attrs {
name: "op_namescope"
......
......@@ -50,7 +50,8 @@ def inference():
accessors = [
{ "class": "AbacusSparseUpdateAccessor", "input": "sparses", "table_id": 0, "need_gradient": True},
{ "class": "DenseInputAccessor", "input": "vars", "table_id": 3, "need_gradient": True, "async_pull": True},
{ "class": "DenseInputAccessor", "input": "vars", "table_id": 5, "need_gradient": True, "async_pull": True},
{ "class": "WeightsAdjustAccessor", "input": "ins_weight", "slot_id": 6002, "adjw_ratio": 20, "adjw_threshold": 1000 },
{ "class": "LabelInputAccessor", "input": "labels"}
]
monitors = [
......@@ -77,9 +78,17 @@ def loss_function(ctr_output):
list<Variable>: labels
"""
# TODO: calc loss here
ins_weight = fluid.layers.data(
name="ins_weight",
shape=[-1, 1],
dtype="float32",
lod_level=0,
append_batch_size=False,
stop_gradient=True)
label = fluid.layers.data(name='label_ctr', shape=ctr_output.shape, dtype='float32')
loss = fluid.layers.log_loss(input=ctr_output, label=label)
loss = fluid.layers.elementwise_mul(loss, ins_weight)
loss = fluid.layers.mean(loss, name='loss_ctr')
return loss, [label]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册