Skip to content
Closed
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
8 changes: 4 additions & 4 deletions bittensor/_neuron/text/core_validator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ def run_epoch( self ):
# console table - weight table (every validation step)
sample_uids, sample_weights = self.calculate_weights()
self.vlogger.print_weights_table(
min_allowed_weights = self.subtensor.min_allowed_weights,
max_weight_limit = self.subtensor.max_weight_limit,
min_allowed_weights = self.subtensor.min_allowed_weights( netuid = self.config.netuid ),
max_weight_limit = self.subtensor.max_weight_limit( netuid = self.config.netuid ),
neuron_stats = self.neuron_stats,
title = str(self),
metagraph_n = self.metagraph.n,
Expand Down Expand Up @@ -559,8 +559,8 @@ def run_epoch( self ):
if self.config.logging.debug or self.config.logging.trace:
# console table - weight table (every end of epoch)
self.vlogger.print_weights_table(
min_allowed_weights = self.subtensor.min_allowed_weights,
max_weight_limit = self.subtensor.max_weight_limit,
min_allowed_weights = self.subtensor.min_allowed_weights( netuid = self.config.netuid ),
max_weight_limit = self.subtensor.max_weight_limit( netuid = self.config.netuid ),
neuron_stats = self.neuron_stats,
title = str(self),
metagraph_n = self.metagraph.n,
Expand Down
11 changes: 9 additions & 2 deletions bittensor/_neuron/text/log_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,20 @@ def print_weights_table(
_neuron_stats = {uid: stats for uid, stats in _neuron_stats.items() if uid in limited_uids}

print()
max_str: str = 'NA'
min_str: str = 'NA'
if sample_weights.numel() != 0:
# Has weights to print
max_str = f'{sample_weights.max().item():.4g}'
min_str = f'{sample_weights.min().item():.4g}'

self.print_stats_table(_neuron_stats, 'weight',
f'[white] Neuron weights [/white] | ' + title, # title
f'Validated {min_allowed_weights}/'
f'[bold]{len(neuron_stats)}[/bold]/{metagraph_n} (min/[bold]valid[/bold]/total) | '
f'sum:{sample_weights.sum().item():.2g} '
f'[white] max:[bold]{sample_weights.max().item():.4g}[/bold] / '
f'min:[bold]{sample_weights.min().item():.4g}[/bold] [/white] '
f'[white] max:[bold]{max_str}[/bold] / '
f'min:[bold]{min_str}[/bold] [/white] '
f'\[{max_weight_limit:.4g} allowed]', # caption
mark_uids=include_uids)

Expand Down