Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/decay scores #92

Merged
merged 5 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions prompting/base/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ def update_scores(self, rewards: torch.FloatTensor, uids: List[int]):
# shape: [ metagraph.n ]
alpha = self.config.neuron.moving_average_alpha
self.scores = alpha * step_rewards + (1 - alpha) * self.scores
self.scores = (self.scores - self.config.neuron.decay_alpha).clamp(min=0)
bt.logging.debug(f"Updated moving avg scores: {self.scores}")

def save_state(self):
Expand Down
11 changes: 9 additions & 2 deletions prompting/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,14 @@ def add_validator_args(cls, parser):
"--neuron.moving_average_alpha",
type=float,
help="Moving average alpha parameter, how much to add of the new observation.",
default=0.05,
default=0.1,
)

parser.add_argument(
"--neuron.decay_alpha",
type=float,
help="Constant decay rate for the moving average score.",
default=0.001,
)

parser.add_argument(
Expand All @@ -324,7 +331,7 @@ def add_validator_args(cls, parser):
help="The maximum number of TAO allowed to query a validator with a vpermit.",
default=4096,
)

parser.add_argument(
"--wandb.project_name",
type=str,
Expand Down