AI4EPS / PhaseNet

PhaseNet: A Deep-Neural-Network-Based Seismic Arrival Time Picking Method
MIT License
268 stars 111 forks source link

tf.ruduce_sum #37

Open yunshanbai opened 2 years ago

yunshanbai commented 2 years ago

Hi, thank you for your excellent work! May I ask you a question? In model.py(the specific location is shown below), here you choose to use ‘’cross_entropy‘’ to get loss. Is this Code missing ‘’tf. reduce_sum‘’ before ''tf.reduce_mean''? It is inconsistent with the formula H (p, q)_ in the paper. I didn't understand it. Please give me some advice. Thank you.

Bai

https://github.com/wayneweiqiang/PhaseNet/blob/c2f41b39b233a1ec14e95965faee5bcde8615cda/phasenet/model.py#L328

wayneweiqiang commented 2 years ago

Hi Bai, the "softmax_cross_entropy_with_logits" function already sums over the three classes of P, S and noise. Here the reduce_mean is to calculate the mean loss for each data. Let me know if you have any other questions.