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

#378 Feature/sg 281 add kd notebook

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-281-add_kd_notebook
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  1. import torch
  2. from torch.nn import BCEWithLogitsLoss
  3. class BCE(BCEWithLogitsLoss):
  4. """
  5. Binary Cross Entropy Loss
  6. """
  7. def forward(self, input: torch.Tensor, target: torch.Tensor) -> torch.Tensor:
  8. """
  9. @param input: Network's raw output shaped (N,1,*)
  10. @param target: Ground truth shaped (N,*)
  11. """
  12. return super(BCE, self).forward(input.squeeze(1), target.float())
Discard
Tip!

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