MIC-DKFZ / BraTS2017

Apache License 2.0
75 stars 16 forks source link

The losss_vec and loss location in train_fn #12

Closed yianzhongguo closed 6 years ago

yianzhongguo commented 6 years ago

@FabianIsensee Hi, sir. Sorry, another question. In the line 179 of train_network.py: train_fn = theano.function([x_sym, seg_sym], [loss, acc_train, loss_vec], updates=updates), but in the line 238: loss_vec, acc, l = train_fn(data, seg). Maybe the losss_vec and loss location should be swapped, is it? Thank you!

FabianIsensee commented 6 years ago

You are right that is not 100% correct, but that does not matter because all I do with loss_vec/loss is get the mean and for that the result is equavalent. The distinction between loss and loss_vec is only important for the parameter updates (line 175) and there the correct loss variable is used

yianzhongguo commented 6 years ago

@FabianIsensee Thank you, sir. But I am still confused. loss and loss_vec are two different variables: loss = loss_vec.mean(), loss += l2_loss and they differ greatly.

yianzhongguo commented 6 years ago

@FabianIsensee By browsing the tutorial of theano I have made this problem clear. Thank you!