Commit 9b22fa8c authored by Alison Carrera's avatar Alison Carrera
Browse files

Fixed bug in ths impression and reward subtraction.

parent 32eee798
......@@ -185,7 +185,8 @@ class ONN_THS(ONN):
def predict(self, X_data):
pred = self.predict_(X_data)[0]
rewards_0 = self.n_impressions - self.n_rewards
theta_value = np.random.beta(self.n_rewards, rewards_0 + 1)
rewards_0[rewards_0 <= 0] = 1
theta_value = np.random.beta(self.n_rewards, rewards_0)
ranked_arms = np.flip(np.argsort(theta_value), axis=0)
chosen_arm = ranked_arms[0].item()
self.n_impressions[chosen_arm] += 1
......
......@@ -6,7 +6,7 @@ with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name='onn',
version='0.1.5',
version='0.1.6',
description='Online Neural Network',
url='https://github.com/alison-carrera/onn',
author='Alison Carrera',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment