Skip to content

Commit 928a087

Browse files
committed
chore: update scoring mechanizm
1 parent 6c04ee3 commit 928a087

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

neurons/validators/score_manager.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import List
99

1010
from webgenie.base.neuron import BaseNeuron
11-
from webgenie.challenges.challenge import Challenge
11+
from webgenie.challenges.challenge import Challenge, RESERVED_WEIGHTS
1212
from webgenie.constants import CONSIDERING_SESSION_COUNTS, __STATE_VERSION__, WORK_DIR
1313
from webgenie.helpers.weights import save_file_to_wandb
1414

@@ -163,21 +163,33 @@ def update_scores(self, rewards: np.ndarray, uids: List[int], challenge: Challen
163163

164164
def get_scores(self, session_upto: int):
165165
scores = np.zeros(self.neuron.metagraph.n, dtype=np.float32)
166-
tiny_weight = 1 / 128
167-
big_weight = 1.0
168166
for session_number in self.session_results:
169167
if (session_number <= session_upto - CONSIDERING_SESSION_COUNTS or
170168
session_number > session_upto):
171169
continue
172170

173171
winner = self.session_results[session_number]["winner"]
172+
competition_type = self.session_results[session_number]["competition_type"]
174173
if winner == -1:
175174
continue
176-
if session_number == session_upto:
177-
scores[winner] += big_weight
178-
else:
179-
scores[winner] += tiny_weight
175+
scores[winner] += RESERVED_WEIGHTS[competition_type]
180176
return scores
177+
# scores = np.zeros(self.neuron.metagraph.n, dtype=np.float32)
178+
# tiny_weight = 1 / 128
179+
# big_weight = 1.0
180+
# for session_number in self.session_results:
181+
# if (session_number <= session_upto - CONSIDERING_SESSION_COUNTS or
182+
# session_number > session_upto):
183+
# continue
184+
185+
# winner = self.session_results[session_number]["winner"]
186+
# if winner == -1:
187+
# continue
188+
# if session_number == session_upto:
189+
# scores[winner] += big_weight
190+
# else:
191+
# scores[winner] += tiny_weight
192+
# return scores
181193

182194
# if session_upto in self.session_results:
183195
# scores = self.session_results[session_upto]["scores"]

0 commit comments

Comments
 (0)