Skip to content

Commit

Permalink
plot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
glibesyck committed Aug 21, 2024
1 parent b96a1a5 commit a8de82e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
25 changes: 12 additions & 13 deletions tutorials/W2D2_NeuroSymbolicMethods/W2D2_Tutorial1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,15 @@
"###################################################################\n",
"\n",
"new_objs['red^'] = new_objs['red*circle'] * ~new_objs['circle']\n",
"new_objs['circle^'] = new_objs[...] * ~new_objs[...]"
"new_objs['circle^'] = new_objs[...] * ~new_objs[...]\n",
"\n",
"new_obj_sims = np.zeros((len(new_object_names), len(new_object_names)))\n",
"\n",
"for name_idx, name in enumerate(new_object_names):\n",
" for other_idx in range(name_idx, len(new_object_names)):\n",
" new_obj_sims[name_idx, other_idx] = new_obj_sims[other_idx, name_idx] = (new_objs[name] | new_objs[new_object_names[other_idx]]).item()\n",
"\n",
"plot_similarity_matrix(new_obj_sims, new_object_names, values = True)"
]
},
{
Expand All @@ -1240,17 +1248,8 @@
"new_objs = objs\n",
"\n",
"new_objs['red^'] = new_objs['red*circle'] * ~new_objs['circle']\n",
"new_objs['circle^'] = new_objs['red*circle'] * ~new_objs['red']"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {}
},
"outputs": [],
"source": [
"new_objs['circle^'] = new_objs['red*circle'] * ~new_objs['red']\n",
"\n",
"new_obj_sims = np.zeros((len(new_object_names), len(new_object_names)))\n",
"\n",
"for name_idx, name in enumerate(new_object_names):\n",
Expand Down Expand Up @@ -2254,7 +2253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
4 changes: 1 addition & 3 deletions tutorials/W2D2_NeuroSymbolicMethods/W2D2_Tutorial2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,6 @@
" #save loss\n",
" losses.append(np.copy(loss))\n",
"\n",
"plt.figure(figsize=(15,5))\n",
"plot_training_and_choice(losses, sims, ant_names, cons_names, action_names)"
]
},
Expand Down Expand Up @@ -1328,7 +1327,6 @@
" #save loss\n",
" losses.append(np.copy(loss))\n",
"\n",
"plt.figure(figsize=(15,5))\n",
"plot_training_and_choice(losses, sims, ant_names, cons_names, action_names)"
]
},
Expand Down Expand Up @@ -1586,7 +1584,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit a8de82e

Please sign in to comment.