(
data: List,
results: List,
num_samples: int = 4,
)
| 258 | |
| 259 | |
| 260 | def _plot_optimization_results( |
| 261 | data: List, |
| 262 | results: List, |
| 263 | num_samples: int = 4, |
| 264 | ): |
| 265 | samples = np.linspace(0, len(results), num_samples, dtype=int, endpoint=False) |
| 266 | plt.figure(figsize=(5.25, 4.0)) |
| 267 | plt.subplot(2, 1, 1) |
| 268 | plt.plot(results, "o-") |
| 269 | plt.xlabel("Optimization Iteration") |
| 270 | plt.ylabel("FOM") |
| 271 | for k in range(len(samples)): |
| 272 | plt.subplot(2, 4, 5 + k) |
| 273 | plt.imshow(data[samples[k]], cmap="binary", vmin=0.0, vmax=1.0) |
| 274 | plt.axis("off") |
| 275 | plt.title(f"It. {samples[k]+1}") |
| 276 | plt.tight_layout() |
| 277 | plt.show() |
| 278 | |
| 279 | |
| 280 | def run_shape_optimization( |
no test coverage detected