@@ -460,7 +460,7 @@ def denormalize(self, x: th.Tensor) -> th.Tensor:
460460 training_ds = th .utils .data .TensorDataset (
461461 th .stack (coords_set ),
462462 th .stack (design_scalars ).unsqueeze (1 ),
463- * [problem_dataset [key ][:] for key , _ in problem .conditions ],
463+ * [problem_dataset [key ][:] for key in problem .conditions_keys ],
464464 )
465465
466466 cond_tensors = th .stack (training_ds .tensors [2 :])
@@ -481,7 +481,7 @@ def denormalize(self, x: th.Tensor) -> th.Tensor:
481481 discriminator = Discriminator (
482482 latent_dim = args .latent_dim ,
483483 design_scalars = len (design_scalar_keys ),
484- num_conds = len (problem .conditions ),
484+ num_conds = len (problem .conditions_keys ),
485485 design_shape = problem .design_space ["coords" ].shape ,
486486 conds_normalizer = conds_normalizer ,
487487 design_scalars_normalizer = design_scalars_normalizer ,
@@ -490,7 +490,7 @@ def denormalize(self, x: th.Tensor) -> th.Tensor:
490490 generator = Generator (
491491 latent_dim = args .latent_dim ,
492492 noise_dim = args .noise_dim ,
493- num_conds = len (problem .conditions ),
493+ num_conds = len (problem .conditions_keys ),
494494 n_control_points = bezier_control_pts ,
495495 n_data_points = n_data_points ,
496496 conds_normalizer = conds_normalizer ,
@@ -602,7 +602,7 @@ def sample_designs(n_designs: int) -> tuple[th.Tensor, th.Tensor, th.Tensor]:
602602 ax .figure .canvas .draw ()
603603 img = np .array (fig .canvas .renderer .buffer_rgba ())
604604 axes [j ].imshow (img )
605- title = [(problem .conditions [i - 1 ][ 0 ], f"{ do1 [i ]:.2f} " ) for i in range (1 , len (do1 ))]
605+ title = [(problem .conditions_keys [i - 1 ], f"{ do1 [i ]:.2f} " ) for i in range (1 , len (do1 ))]
606606 title_string = "\n " .join (f"{ condition } : { value } " for condition , value in title )
607607 axes [j ].title .set_text (title_string ) # Set title
608608 axes [j ].set_xticks ([])
0 commit comments