Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the image's type to the image parameter. #101

Open
wants to merge 2 commits into
base: fall22
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update practice.ipynb
  • Loading branch information
AI-Ahmed authored Dec 13, 2022
commit 9f57d72819ddd541854bd1308c0da36ceee0944a
2 changes: 1 addition & 1 deletion week07_interpretability/practice.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"metadata": {},
"outputs": [],
"source": [
"def explain_smoothgrad(image: torch.Tensor, class_ix, num_runs=32, sigma=0.1):\n",
"def explain_smoothgrad(image: np.ndarray, class_ix, num_runs=32, sigma=0.1):\n",
" image_tensor = torch.as_tensor(image, device=device, dtype=torch.float32)\n",
" image_tensor = image_tensor[None].permute(0, 3, 1, 2) # shape: [1, 3, h, w]\n",
" \n",
Expand Down