simonjegou commited on
Commit
cfe8c32
·
verified ·
1 Parent(s): 957fb5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -27,7 +27,7 @@ R5 = Rk[Rk.sum(axis=1) == 5] # size 252
27
  fact = np.array([1, 1, 2, 6, 24, 120])
28
  Δ = R5[None, :] - Rk[:, None] # Δ[rk, r5, i]: number of die #i missing to go from Rk[rk] to R5[r5]
29
  P = np.where((Δ >= 0).all(axis=2), fact[Δ.sum(axis=2)] // np.prod(fact[Δ.clip(min=0)], axis=2), 0)
30
- P /= P.sum(axis=1, keepdims=True)
31
  M = (P > 0).T # Mask for valid transitions
32
 
33
  # Calculate category scores for all R5 outcomes
 
27
  fact = np.array([1, 1, 2, 6, 24, 120])
28
  Δ = R5[None, :] - Rk[:, None] # Δ[rk, r5, i]: number of die #i missing to go from Rk[rk] to R5[r5]
29
  P = np.where((Δ >= 0).all(axis=2), fact[Δ.sum(axis=2)] // np.prod(fact[Δ.clip(min=0)], axis=2), 0)
30
+ P = P / P.sum(axis=1, keepdims=True)
31
  M = (P > 0).T # Mask for valid transitions
32
 
33
  # Calculate category scores for all R5 outcomes