cos_sim layer 固定两个输入之一的参数时backward时出错
Created by: hiahiahu
如下配置所示 其中title_id -> title_emb ->title_pooling ->hidden_title所有的参数都设置is_static,调整query分支的参数
CosSimLayer(name='cos_sim', inputs = ['hidden_query', 'hidden_title'],)
在cosSimLayer 梯度更新的时候出错:
Thread [140089823160384] Backwarding cos_sim, hidden_query, query_vec, query_emb, query, hidden_title2, hidden_title, title_vec, title_emb, title,
*** Aborted at 1484644575 (unix time) try "date -d @1484644575" if you are using GNU date ***
PC: @ 0x794d34 paddle::CpuMatrix::cosSimDerivative()
*** SIGSEGV (@0x10) received by PID 24118 (TID 0x7f6934256840) from PID 16; stack trace: ***
@ 0x7f6933e31160 (unknown)
@ 0x794d34 paddle::CpuMatrix::cosSimDerivative()
@ 0x6c0ba0 paddle::CosSimLayer::backward()
@ 0x6dee40 paddle::NeuralNetwork::backward()
@ 0x73f123 paddle::TrainerInternal::forwardBackwardBatch()
@ 0x73ff13 paddle::TrainerInternal::trainOneBatch()
@ 0x73a9c0 paddle::Trainer::trainOneDataBatch()
@ 0x73d6ce paddle::Trainer::trainOnePass()
@ 0x73ea05 paddle::Trainer::train()
@ 0x5b872a main
@ 0x7f6932a4ebd5 __libc_start_main @ 0x5cdbc5 (unknown) /home/hupeng/platform_test/paddle_internal_release_tools/idl/paddle/output/bin/paddle_local: line 109: 24118 Segmentation fault (core dumped) ${DEBUGGER} $MYDIR/../opt/paddle/bin/paddle_trainer ${@:2}
推测是不是cos_layer设计的时候就写死了两个输入都要进行更新? 没考虑输入时is_static的情形?