Skip to content

Commit

Permalink
Tidy up LSI MNIST notebook (#444)
Browse files Browse the repository at this point in the history
## Description

<!-- Provide a brief description of the PR's purpose here. -->

Small fixes such as unused imports and variables.

## Status

- [x] I have read the guidelines in

[CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md)
- [x] I have formatted my code using `yapf`
- [x] I have tested my code by running `pytest`
- [x] I have linted my code with `pylint`
- [x] I have added a one-line description of my change to the changelog
in
      `HISTORY.md`
- [x] This PR is ready to go
  • Loading branch information
btjanaka committed Dec 21, 2023
1 parent 1c2c831 commit 7e08f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
- Add cron job for testing installation ({pr}`389`, {pr}`401`)
- Fix broken cross-refs in docs ({pr}`393`)

#### Documentation

- Tidy up LSI MNIST notebook ({pr}`444`)

## 0.6.4

Small release that adds the scalable CMA-MAE tutorial.
Expand Down
6 changes: 1 addition & 5 deletions tutorials/lsi_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@
"metadata": {},
"outputs": [],
"source": [
"import time\n",
"import sys\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import torch\n",
"import torch.nn as nn\n",
"import torchvision\n",
"from tqdm import tqdm, trange"
]
},
Expand Down Expand Up @@ -341,8 +339,6 @@
],
"source": [
"total_itrs = 30_000\n",
"flat_img_size = 784 # 28 * 28\n",
"start_time = time.time()\n",
"\n",
"for itr in trange(1, total_itrs + 1, file=sys.stdout, desc='Iterations'):\n",
" sols = scheduler.ask()\n",
Expand All @@ -368,7 +364,7 @@
"\n",
" # Shape: len(sols) x 784\n",
" flattened_imgs = normalized_imgs.cpu().numpy().reshape(\n",
" (-1, flat_img_size))\n",
" (normalized_imgs.shape[0], -1))\n",
"\n",
" # The first measures is the \"boldness\" of the digit (i.e. number of white\n",
" # pixels). We consider pixels with values larger than or equal to 0.5\n",
Expand Down

0 comments on commit 7e08f3a

Please sign in to comment.