Skip to content

Commit

Permalink
fix shape
Browse files Browse the repository at this point in the history
  • Loading branch information
jduerholt committed Nov 30, 2023
1 parent eefa4a2 commit 5800d05
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bofire/strategies/samplers/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _ask(self, n: int) -> pd.DataFrame:
n_burnin=self.n_burnin,
thinning=self.n_thinning,
seed=self.seed,
)
).squeeze(dim=0)

# check that the random generated candidates are not always the same
if (candidates.unique(dim=0).shape[0] != n) and (n > 1):
Expand All @@ -154,10 +154,9 @@ def _ask(self, n: int) -> pd.DataFrame:
for feat in self.domain.get_features(ContinuousInput)
if feat.key not in fixed_features.keys() # type: ignore
]

# setup the output
samples = pd.DataFrame(
data=candidates.detach().numpy().reshape(n, len(free_continuals)),
data=candidates.detach().numpy(),
index=range(n),
columns=free_continuals,
)
Expand Down

0 comments on commit 5800d05

Please sign in to comment.