Skip to content

Commit

Permalink
Fix remaining usages
Browse files Browse the repository at this point in the history
  • Loading branch information
btjanaka committed Nov 2, 2023
1 parent bc1ec94 commit 9e726d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ribs/archives/_archive_data_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def iterelites(self):
"""Iterator that outputs every elite in the ArchiveDataFrame.
Data which is unavailable will be turned into None. For example, if
there are no solution columns, then ``elite.solution`` will be None.
there are no solution columns, then ``elite["solution"]`` will be None.
"""
solution_batch = self.solution_batch()
objective_batch = self.objective_batch()
Expand Down
4 changes: 2 additions & 2 deletions tutorials/arm_repertoire.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@
"source": [
"elite = archive.retrieve_single([0, 0])\n",
"_, ax = plt.subplots()\n",
"if elite.solution is not None: # This is None if there is no solution for [0,0].\n",
" visualize(elite.solution, link_lengths, elite.objective, ax)"
"if elite[\"solution\"] is not None: # This is None if there is no solution for [0,0].\n",
" visualize(elite[\"solution\"], link_lengths, elite[\"objective\"], ax)"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions tutorials/fooling_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,13 @@
"\n",
"# Display images.\n",
"for elite in archive:\n",
" digit = elite.index\n",
" digit = elite[\"index\"]\n",
" found.add(digit)\n",
"\n",
" # No need to normalize image because we want to see the original.\n",
" ax[digit].imshow(elite.solution.reshape(28, 28), cmap=\"Greys\")\n",
" ax[digit].imshow(elite[\"solution\"].reshape(28, 28), cmap=\"Greys\")\n",
" ax[digit].set_axis_off()\n",
" ax[digit].set_title(f\"{digit} | Score: {elite.objective:.3f}\", pad=8)\n",
" ax[digit].set_title(f\"{digit} | Score: {elite['objective']:.3f}\", pad=8)\n",
"\n",
"# Mark digits that we did not generate images for.\n",
"for digit in range(10):\n",
Expand Down

0 comments on commit 9e726d1

Please sign in to comment.