Skip to content

Commit

Permalink
test loss function
Browse files Browse the repository at this point in the history
  • Loading branch information
Arno1235 committed Mar 20, 2023
1 parent 6ec1e3d commit fc3d3ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions unet_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ def get_loss(self, logits, labels):

loss_map = tf.nn.softmax_cross_entropy_with_logits(logits=flat_logits, labels=flat_labels)
print(f'TEST loss map: {loss_map}, size: {len(loss_map)}')
probs = tf.nn.softmax(logits, axis=-1)
flat_probs = tf.reshape(probs, [-1, self.n_class])
print(f'TEST probs: {probs}, flat_probs: {flat_probs}')

if self.weight_type is None:
loss = tf.reduce_mean(loss_map)
Expand Down

0 comments on commit fc3d3ce

Please sign in to comment.