Spaces:
Sleeping
Sleeping
skanderovitch
commited on
Commit
•
720abd1
1
Parent(s):
606728b
Update app.py
Browse files
app.py
CHANGED
@@ -69,7 +69,7 @@ if st.session_state.stage == 0:
|
|
69 |
|
70 |
|
71 |
|
72 |
-
def make_pred(max_history=st.session_state.max_history,alpha=
|
73 |
history = st.session_state.history
|
74 |
|
75 |
denominator = 0
|
@@ -83,7 +83,7 @@ def make_pred(max_history=st.session_state.max_history,alpha=0.5):
|
|
83 |
decay = np.exp(-alpha*np.linspace(1,0,len(past)))
|
84 |
same = past == recent[-len(past):]
|
85 |
similarity = (same*decay).sum() / decay.sum()
|
86 |
-
weight = len(history)/(len(history)+i) * similarity
|
87 |
scores[played] += weight
|
88 |
denominator += weight
|
89 |
if similarity > 0.5:
|
|
|
69 |
|
70 |
|
71 |
|
72 |
+
def make_pred(max_history=st.session_state.max_history,alpha=2):
|
73 |
history = st.session_state.history
|
74 |
|
75 |
denominator = 0
|
|
|
83 |
decay = np.exp(-alpha*np.linspace(1,0,len(past)))
|
84 |
same = past == recent[-len(past):]
|
85 |
similarity = (same*decay).sum() / decay.sum()
|
86 |
+
weight = np.exp(-alpha*i/(len(history)+1)) * similarity # len(history)/(len(history)+i) * similarity
|
87 |
scores[played] += weight
|
88 |
denominator += weight
|
89 |
if similarity > 0.5:
|