Skip to content

Commit

Permalink
Fix for Issue phlippe#11
Browse files Browse the repository at this point in the history
  • Loading branch information
awe-sim committed Oct 19, 2021
1 parent 7cb5765 commit 4966765
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3809,9 +3809,9 @@
" model_inputs = torch.stack([xx1, xx2], dim=-1)\n",
" preds = model(model_inputs)\n",
" preds = torch.sigmoid(preds)\n",
" output_image = preds * c0[None,None] + (1 - preds) * c1[None,None] # Specifying \"None\" in a dimension creates a new one\n",
" output_image = (1 - preds) * c0[None,None] + preds * c1[None,None] # Specifying \"None\" in a dimension creates a new one\n",
" output_image = output_image.cpu().numpy() # Convert to numpy array. This only works for tensors on CPU, hence first push to CPU\n",
" plt.imshow(output_image, origin='upper', extent=(-0.5, 1.5, -0.5, 1.5))\n",
" plt.imshow(output_image, origin='lower', extent=(-0.5, 1.5, -0.5, 1.5))\n",
" plt.grid(False)\n",
"\n",
"visualize_classification(model, dataset.data, dataset.label)\n",
Expand Down

0 comments on commit 4966765

Please sign in to comment.