matrix_SPSA_algorithm.calculate_numerator_SPSA#

matrix_SPSA_algorithm.calculate_numerator_SPSA(high_stat: ndarray, high_transition_matrix: ndarray, low_stat: ndarray, low_transition_matrix: ndarray, ALGORITHM_PARAMETERS: dict[str, Any]) float#

Calculates the numerator of the SPSA gradient.

Parameters:
  • high_stat (np.ndarray) – The stationary distribution of the plus perturbation.

  • high_transition_matrix (np.ndarray) – The transition matrix of the plus perturbation.

  • low_stat (np.ndarray) – The stationary distribution of the minus perturbation.

  • low_transition_matrix (np.ndarray) – The transition matrix of the minus perturbation.

  • ALGORITHM_PARAMETERS (dict[str, Any]) – The algorithm parameters. Methods that are called within this method require parameters. See these methods for explanations.

Returns:

num (float) – The numerator of the SPSA gradient.