Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#970 Update YoloNASQuickstart.md

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:bugfix/SG-000_fix_readme_yolonas_snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  1. from typing import Tuple
  2. import torch.nn.functional
  3. from torch import nn, Tensor
  4. from super_gradients.common.object_names import Losses
  5. from super_gradients.common.registry import register_loss
  6. @register_loss(Losses.RESCORING_LOSS)
  7. class RescoringLoss(nn.Module):
  8. def __init__(self):
  9. super().__init__()
  10. def forward(self, predictions: Tuple[Tensor, Tensor], targets):
  11. """
  12. :param predictions: Tuple of (poses, scores)
  13. :param targets: Target scores
  14. :return: KD loss between predicted scores and target scores
  15. """
  16. return torch.nn.functional.binary_cross_entropy_with_logits(predictions[1], targets)
Discard
Tip!

Press p or to see the previous file or, n or to see the next file