Skip to content

Commit

Permalink
Revert "Change label smoothing to 0.1"
Browse files Browse the repository at this point in the history
This reverts commit c0f7245.
  • Loading branch information
ankandrew committed Mar 31, 2024
1 parent c0f7245 commit f8452b3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fast_plate_ocr/model/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def top_3_k(y_true, y_pred):


# Custom loss
def cce_loss(vocabulary_size: int, label_smoothing: float = 0.1):
def cce_loss(vocabulary_size: int):
"""
Categorical cross-entropy loss.
"""
Expand All @@ -73,9 +73,7 @@ def cce(y_true, y_pred):
y_true = ops.reshape(y_true, newshape=(-1, vocabulary_size))
y_pred = ops.reshape(y_pred, newshape=(-1, vocabulary_size))
return ops.mean(
losses.categorical_crossentropy(
y_true, y_pred, from_logits=False, label_smoothing=label_smoothing
)
losses.categorical_crossentropy(y_true, y_pred, from_logits=False, label_smoothing=0.2)
)

return cce

0 comments on commit f8452b3

Please sign in to comment.