May I ask a question about equation and code?
Closed this issue · 3 comments
Hi Shangran Qiu,
Thank your attention.May I get your help?
- In "utils.py", "demor = [(demor[0]-70.0)/10.0] + gender + [(demor[2]-27)/2] ". May I ask what is the meaning of this formula and how it was obtained.
- In "utils.py", "def get_AD_risk(raw)" , " x1, x2 = raw[0, :, :, :], raw[1, :, :, :]". In the data preprocessing part, the .npy file is three-dimensional information, but there is a four-dimensional information, which causes the system to report an error. Therefore, May I ask how to solve it.
3.In "utils.py", "def get_AD_risk(raw)" , "risk = np.exp(x2) / (np.exp(x1) + np.exp(x2))". May I ask that, why can we get risk from raw data through this equation.
I appreciate your work very much. Once again, thank you for your time and kindly help. I am looking forward to hearning from you.
hi, sure,
to answer your first question, demor in line 128 is a list where demor[0] is the age, demor[1] is gender and demor[2] is mmse score. in line 129, gender is transfered into a one hot, then in line 130, demor vector was rebuilt with the first element as normalized age (demor[0]-70.0)/10.0, with the second and third element from the one hot vector of gender, and the last element as normalized MMSE score (demor[2]-27)/2
for you second and third question: "raw" variable here refers to the raw output of the FCN model which is in shape (2, x, y, z), the x1, x2 = raw[0, :, :, :], raw[1, :, :, :] represents the channel corresponding to NC and AD. Thus, by taking the softmax on top of both, risk = np.exp(x2) / (np.exp(x1) + np.exp(x2)) you will get "risk" variable as AD probability. You can get more details if you search for the softmax operation.
Thank you very much.