liuyuuan
liuyuuan
有些场景下需要对Layer的输出向量做2范数归一化,PaddlePaddle当前似乎不能直接支持此操作。 考虑间接的使用其他Layer来完成此操作: ```python squared_l2_norm = mixed_layer(inputs = dot_mul_operator(to_be_normed_vec, to_be_normed_vec)) # 开平方,square_root_power 是形如 [0.5] 的data_layer l2_norm = power_layer(inputs = [square_root_power, squared_l2_norm]) # 求倒数,reciprocal_power是形如[-1.0]的data_layer reciprocal_l2_norm = power_layer(inputs = [reciprocal_power, l2_norm]) # 给原始向量的每一位都乘以...
我使用了如下的训练过程: ```python def train(args): paddle.init(use_gpu=args.use_gpu, trainer_count=args.trainer_count) optimizer = paddle.optimizer.Momentum( momentum=0.9, learning_rate=1e-3, regularization=paddle.optimizer.L2Regularization(rate=1e-3)) feeding = {...} reader = some_dataset.create_reader() train_batch_reader = paddle.batch(reader=reader, batch_size=args.batch_size) cost = my_network(args) parameters = paddle.parameters.create(cost) def event_handler(event):...
I'm implementing a pointer network with PaddlePaddle, which does a softmax over a sequence, and the picks the index with the maximum probability. Now I want to output the sequence...
使用GPU训练时,出现如下错误: ```text 125 [INFO 2017-10-15 18:36:14,705 trainer.py:81] Pass=0 Batch=840 Cost=7.03243 AvgCost=6.70295 126 F1015 18:38:03.304704 12823 hl_gpu_matrix_kernel.cuh:181] Check failed: cudaSuccess == err (0 vs. 9) [hl_gpu_apply_unary_op failed] CUDA error: invalid configuration...
I have a project where many parts of it use openmp or std::thread for parallelization, and it works fine on a 12-core linux server. Now I use openblas in one...
我的space中定义了5个字段,其中一个是向量字段,剩下为标量字段。我只想更新其中的一个标量(增加1),但是似乎需要在这里传入完成的5个字段的值,并且修改想更新的字段的值才可以,只传入待更新字段就会报错。 但这个更新成本就会变的很高,因为需要重新计算向量字段的值。 VEARCH版本:https://hub.docker.com/layers/ansj/vearch/0.3.2/images/sha256-9f28cccbd7f0e5262bcd172e38d291a3a960f11b5689fe65d1342d3639f16ad8?context=explore 更新命令: ``` curl -XPOST -H "content-type: application/json" http://${router_server}/${db_name}/${space_name}/${id}/_update -d '{ "doc": { "field1": 2 } }' ``` 返回 ``` {"_index":"sentence_topk","_type":"sentences","_id":"text1","status":550,"error":{"index":"","index_uuid":"","shard":"0","type":"","reason":"field num:[1] not same by schema:[5]"}} ```