Skip to content

Instantly share code, notes, and snippets.

@santi-pdp
Created January 24, 2018 17:53
Show Gist options
  • Select an option

  • Save santi-pdp/d0e9002afe74db04aa5bbff6d076e8fe to your computer and use it in GitHub Desktop.

Select an option

Save santi-pdp/d0e9002afe74db04aa5bbff6d076e8fe to your computer and use it in GitHub Desktop.
Toy example in pytorch for binary classification
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mnauf

mnauf commented Sep 21, 2019

Copy link
Copy Markdown

BCEWithLogitsLoss() expects logits as inputs and not probabilities, so you shouldnt do y = self.out_act(a3)

@mdja

mdja commented Sep 27, 2020

Copy link
Copy Markdown

BCEWithLogitsLoss() expects logits as inputs and not probabilities, so you shouldnt do y = self.out_act(a3)

But he's using BCELoss not BCEWithLogitsLoss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment