Skip to content

Commit

Permalink
Update default decay value in TS
Browse files Browse the repository at this point in the history
  • Loading branch information
m-wojnar committed Apr 10, 2024
1 parent eee76ca commit 1560e01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions reinforced_lib/agents/mab/thompson_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ThompsonSampling(BaseAgent):
----------
n_arms : int
Number of bandit arms. :math:`N \in \mathbb{N}_{+}`.
decay : float, default=1.0
decay : float, default=0.0
Decay rate. If equal to zero, smoothing is not applied. :math:`w \geq 0`.
References
Expand All @@ -45,7 +45,7 @@ class ThompsonSampling(BaseAgent):
for Wi-Fi 6 Dense Deployments. IEEE Access. 8. 168898-168909.
"""

def __init__(self, n_arms: int, decay: Scalar = 1.0) -> None:
def __init__(self, n_arms: int, decay: Scalar = 0.0) -> None:
assert decay >= 0

self.n_arms = n_arms
Expand Down Expand Up @@ -101,8 +101,8 @@ def init(key: PRNGKey, n_arms: int) -> ThompsonSamplingState:
"""

return ThompsonSamplingState(
alpha=jnp.zeros((n_arms,1)),
beta=jnp.zeros((n_arms,1))
alpha=jnp.zeros((n_arms, 1)),
beta=jnp.zeros((n_arms, 1))
)

@staticmethod
Expand Down

0 comments on commit 1560e01

Please sign in to comment.