What is minimize target parameter in TMVA::DNN when my target variable is an array?

Hello, I want to reconstruct the direction of a particle, so I store the vx,vy,vz into an array called “direction”. I use the code “dataloader->AddTarget( “direction” )” to add the variable and use “CROSSENTROPY” as the loss function. But in this condition, what is the minimize target parameter?

Hello, @moneta, could you please help me?

Hi, @kialbert Can I define the equation form of “SUMOFSQUARES” in the DNN method by myself?
Thank you very much!

Hi,
You can have multiple target in TMVA, they are supported. You need to add vx,vy and vz as three separate targets. In case of regression you should not use CROSSENTROPY for the loss function, but SUMOFSQUARES , i.e. a mean square error function

Sorry for the delay in replying. I realised that my message did not go through before

Lorenzo

Hi, moneta, thank you very much for your reply! I have added vx,vy and vz as three separate targets, and use the “SUMOFSQUARES”. In this way, the loss function will be “sqrt((vx-vx’)**2+(vy-vy’)**2+(vz-vz’)**2)”, it means the neutral networks will minimize this function. But for direction reconstruction, I need minimize the function of “(vxvx’+vyvy’+vz*vz’-1)**2” which means (vx,vy,vz) and (vx’,vy’,vz’) these two unit vectors are collinear. So these two functions are not exactly equivalent,can I define the loss function by myslef?
Thank you very much!

Hi,

Unfortunately it is not possible to define the loss function yourself in TMVA::DNN. It is not trivial to do it, because one needs to implement, function and gradient for both CPU and GPU.
If it is a common used function we could add it. Can you in case provide a reference to this loss function ?

Best regards

Lorenzo