Skip to content

Commit

Permalink
minor bugfixes to avoid training errors in UnconstrainedActionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
yasserfarouk committed Jul 12, 2023
1 parent 5ad1381 commit 58d58c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/scml/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def integer_cut(
k = 0
while sizes.sum() < n:
if randomize:
j, k = k, k + 1
j, k = valid[k], k + 1
if k >= len(valid):
k = 0
else:
Expand Down
5 changes: 4 additions & 1 deletion src/scml/oneshot/rl/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,10 @@ def decode(self, awi: OneShotAWI, action: np.ndarray) -> dict[str, SAOResponse]:
for partner, (q, p) in zip(partners, action):
nmi = nmis.get(partner, None)
if not nmi:
raise AssertionError(f"Did not find {partner} in the list of partners")
warnings.warn(
f"Did not find {partner} in the list of partners\n{partners=}\n{awi.my_partners=}\n{action=}"
)
continue
qscale = nmi.issues[QUANTITY].max_value / (self.max_quantity - 1)
pscale = (nmi.issues[UNIT_PRICE].max_value + 1) / self.n_prices
scaled.append(
Expand Down

0 comments on commit 58d58c6

Please sign in to comment.