# Path: reservoir_nn/utils/weight_properties.py
# def print_network_statistics(weight, plot_weight=False):
# def get_network_statistics(weight):
# def get_inhibitory_proportion_of_total_strength(weight):
# def get_inhibitory_neuron_indices(weight):
# def get_sparsity(matrix: np.ndarray, thres=0.0) -> float:
# def get_spectral_radius(square_matrix: np.ndarray) -> float:


import abc
import textwrap
import deprecation
import ml_collections
import numpy as np
from typing import List, Optional, Sequence, Tuple, Union
from reservoir_nn.utils import weight_properties
from scipy import stats
      for i in range(num_row):
        weight_row = matrix_transformed[i]

        # get indices of num_remove_per_row smallest elements of this row
        small_weight_indices = weight_row.argsort()[:num_remove_per_row]

        # and set these values zero:
        weight_row[small_weight_indices] = 0.0

    return matrix_transformed


class ScaleToZeroOne(WeightTransformation):
  """Scales the weight matrix to the [0, 1] range."""

  def __init__(self):
    pass

  def apply_transform(self, matrix: np.ndarray) -> np.ndarray:
    matrix = matrix - matrix.min()
    return matrix / matrix.max()


class ScaleSpectralRadius(WeightTransformation):
  """Scales the weight matrix to specified spectral radius."""

  def __init__(self, spectral_radius: float = 1.0):
    self.spectral_radius = spectral_radius

  def apply_transform(self, matrix: np.ndarray) -> np.ndarray:

# Path: reservoir_nn/utils/weight_properties.py
# def print_network_statistics(weight, plot_weight=False):
# def get_network_statistics(weight):
# def get_inhibitory_proportion_of_total_strength(weight):
# def get_inhibitory_neuron_indices(weight):
# def get_sparsity(matrix: np.ndarray, thres=0.0) -> float:
# def get_spectral_radius(square_matrix: np.ndarray) -> float:


# Path: reservoir_nn/utils/weight_transforms.py
import abc
import textwrap
import deprecation
import ml_collections
import numpy as np
from typing import List, Optional, Sequence, Tuple, Union
from reservoir_nn.utils import weight_properties
from scipy import stats

      for i in range(num_row):
        weight_row = matrix_transformed[i]

        # get indices of num_remove_per_row smallest elements of this row
        small_weight_indices = weight_row.argsort()[:num_remove_per_row]

        # and set these values zero:
        weight_row[small_weight_indices] = 0.0

    return matrix_transformed


class ScaleToZeroOne(WeightTransformation):
  """Scales the weight matrix to the [0, 1] range."""

  def __init__(self):
    pass

  def apply_transform(self, matrix: np.ndarray) -> np.ndarray:
    matrix = matrix - matrix.min()
    return matrix / matrix.max()


class ScaleSpectralRadius(WeightTransformation):
  """Scales the weight matrix to specified spectral radius."""

  def __init__(self, spectral_radius: float = 1.0):
    self.spectral_radius = spectral_radius

  def apply_transform(self, matrix: np.ndarray) -> np.ndarray:

    matrix_spectral_radius = weight_properties.get_spectral_radius(matrix)