Skip to content

Commit

Permalink
Test jupyter-book deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
cbbcbail committed Jul 19, 2024
1 parent 7b801aa commit fb2809d
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions jupyter/Fig1-designProcess.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -222,23 +222,23 @@
"metadata": {},
"outputs": [],
"source": [
"subsetSize = 80 # The size of subsets being selected with blended objectives\n",
"# subsetSize = 80 # The size of subsets being selected with blended objectives\n",
"\n",
"# Use distribution and distinctness objectives\n",
"objectives = [fss.objective.earthMoversDistance, fss.objective.distinctness]\n",
"# # Use distribution and distinctness objectives\n",
"# objectives = [fss.objective.earthMoversDistance, fss.objective.distinctness]\n",
"\n",
"# Parameters of the distribution and distinctness objectives\n",
"parameters = [{\"dataset\": dataset.dataArray}, \n",
" {\"solveArray\": \"distances\", \"selectBy\": \"matrix\"}]\n",
"# # Parameters of the distribution and distinctness objectives\n",
"# parameters = [{\"dataset\": dataset.dataArray}, \n",
"# {\"solveArray\": \"distances\", \"selectBy\": \"matrix\"}]\n",
"\n",
"# Create the multicriterion loss function from the objectives and weight them\n",
"solver.lossFunction = fss.MultiCriterion(objectives = objectives, \n",
" parameters = parameters, \n",
" weights=[100, 1])\n",
"# # Create the multicriterion loss function from the objectives and weight them\n",
"# solver.lossFunction = fss.MultiCriterion(objectives = objectives, \n",
"# parameters = parameters, \n",
"# weights=[100, 1])\n",
"\n",
"# Solve for the blended distribution and distinctness subset\n",
"subsetBlend1 = solver.solve(dataset, subsetSize=subsetSize, verbose=verbose)\n",
"subsetBlend1.save(f\"{directory}/blend1Subset\")"
"# # Solve for the blended distribution and distinctness subset\n",
"# subsetBlend1 = solver.solve(dataset, subsetSize=subsetSize, verbose=verbose)\n",
"# subsetBlend1.save(f\"{directory}/blend1Subset\")"
]
},
{
Expand All @@ -247,14 +247,14 @@
"metadata": {},
"outputs": [],
"source": [
"# Update the weights to provide less emphasis on the distribution objective\n",
"solver.lossFunction = fss.MultiCriterion(objectives = objectives, \n",
" parameters = parameters, \n",
" weights=[50, 1])\n",
"\n",
"# Solve for the blended distribution and distinctness subset\n",
"subsetBlend2 = solver.solve(dataset, subsetSize=subsetSize, verbose=verbose)\n",
"subsetBlend2.save(f\"{directory}/blend2Subset\")"
"# # Update the weights to provide less emphasis on the distribution objective\n",
"# solver.lossFunction = fss.MultiCriterion(objectives = objectives, \n",
"# parameters = parameters, \n",
"# weights=[50, 1])\n",
"\n",
"# # Solve for the blended distribution and distinctness subset\n",
"# subsetBlend2 = solver.solve(dataset, subsetSize=subsetSize, verbose=verbose)\n",
"# subsetBlend2.save(f\"{directory}/blend2Subset\")"
]
},
{
Expand All @@ -263,14 +263,14 @@
"metadata": {},
"outputs": [],
"source": [
"# Update the weights to an even weight of the two objectives\n",
"solver.lossFunction = fss.MultiCriterion(objectives = objectives, \n",
" parameters = parameters, \n",
" weights=[1, 1])\n",
"\n",
"# Solve for the blended distribution and distinctness subset\n",
"subsetBlend3 = solver.solve(dataset, subsetSize=subsetSize, verbose=verbose)\n",
"subsetBlend3.save(f\"{directory}/blend3Subset\")"
"# # Update the weights to an even weight of the two objectives\n",
"# solver.lossFunction = fss.MultiCriterion(objectives = objectives, \n",
"# parameters = parameters, \n",
"# weights=[1, 1])\n",
"\n",
"# # Solve for the blended distribution and distinctness subset\n",
"# subsetBlend3 = solver.solve(dataset, subsetSize=subsetSize, verbose=verbose)\n",
"# subsetBlend3.save(f\"{directory}/blend3Subset\")"
]
},
{
Expand All @@ -288,28 +288,28 @@
"metadata": {},
"outputs": [],
"source": [
"# Plot the three subsets with different blends of the two objectives\n",
"titles = [\"More Distribution,\\nLess Distinct\", \"\", \n",
" \"Less Distribution,\\nMore Distinct\"]\n",
"subsets = [subsetBlend1, subsetBlend2, subsetBlend3]\n",
"\n",
"fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(6.25, 3))\n",
"fig.text(0.49, 1, '2. Blend', ha='center', va='center', fontsize=titleSize)\n",
"\n",
"for i, ax in enumerate(fig.axes):\n",
" ax.grid(visible=False)\n",
" ax.set_xticks([])\n",
" ax.set_yticks([])\n",
" ax.set_title(titles[i], fontsize=subtitleSize)\n",
" ax.set_aspect(\"equal\")\n",
"\n",
" fss.plot.scatter(ax = ax, \n",
" color = color, \n",
" dataset = dataset, \n",
" subset = subsets[i], \n",
" alpha = 0.6)\n",
"\n",
"plt.savefig(f\"../figures/{directory}/blend.pdf\", bbox_inches=\"tight\")"
"# # Plot the three subsets with different blends of the two objectives\n",
"# titles = [\"More Distribution,\\nLess Distinct\", \"\", \n",
"# \"Less Distribution,\\nMore Distinct\"]\n",
"# subsets = [subsetBlend1, subsetBlend2, subsetBlend3]\n",
"\n",
"# fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(6.25, 3))\n",
"# fig.text(0.49, 1, '2. Blend', ha='center', va='center', fontsize=titleSize)\n",
"\n",
"# for i, ax in enumerate(fig.axes):\n",
"# ax.grid(visible=False)\n",
"# ax.set_xticks([])\n",
"# ax.set_yticks([])\n",
"# ax.set_title(titles[i], fontsize=subtitleSize)\n",
"# ax.set_aspect(\"equal\")\n",
"\n",
"# fss.plot.scatter(ax = ax, \n",
"# color = color, \n",
"# dataset = dataset, \n",
"# subset = subsets[i], \n",
"# alpha = 0.6)\n",
"\n",
"# plt.savefig(f\"../figures/{directory}/blend.pdf\", bbox_inches=\"tight\")"
]
},
{
Expand Down

0 comments on commit fb2809d

Please sign in to comment.