diff --git a/bittensor/_neuron/text/core_validator/__init__.py b/bittensor/_neuron/text/core_validator/__init__.py index 0d5fefb18d..ef432997ca 100644 --- a/bittensor/_neuron/text/core_validator/__init__.py +++ b/bittensor/_neuron/text/core_validator/__init__.py @@ -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, @@ -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, diff --git a/bittensor/_neuron/text/log_utilities.py b/bittensor/_neuron/text/log_utilities.py index da8e865f97..3e06186c14 100644 --- a/bittensor/_neuron/text/log_utilities.py +++ b/bittensor/_neuron/text/log_utilities.py @@ -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)