Skip to content

How to make smooth_l1_loss? #3176

Answered by wjessup
wjessup asked this question in Q&A
Jan 19, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

solved:

diff = Tensor.where(diff.detach() < 1.0, 0.5 * diff ** 2, diff - 0.5 * 1.0 ).mean()
```

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wjessup
Comment options

@wjessup
Comment options

Answer selected by wozeparrot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants