input_output_functions.save_and_plot_results#

input_output_functions.save_and_plot_results(M: ndarray, C: ndarray, stationary_distributions: ndarray, transition_matrices: ndarray, thetas: ndarray, objective_values: ndarray, gradient_estimates: ndarray, ALGORITHM_PARAMETERS: dict[str, Any]) None#

Saves and creates the plots and output matrices for SM-SPSA.

Parameters:
  • M (np.ndarray) – The transition matrix that is optimised.

  • C (np.ndarray) – The binary adjustment matrix.

  • stationary_distributions (np.ndarray) – The stationary distribution of all nodes at each iteration.

  • transition_matrices (np.ndarray) – The transition matrix in the stochastic matrix space at each iteration.

  • thetas (np.ndarray) – The matrix in the unconstrained space at each iteration.

  • objective_values (np.ndarray) – The objective value at each iteration.

  • gradient_estimates (np.ndarray) – The gradient estimate at each iteration.

  • ALGORITHM_PARAMETERS (dict[str, Any]) – The algorithm parameters. The parameters PLOT_OBJECTIVE, PLOT_MATRICES, PLOT_NETWORK, NETWORK_PLOT_FILE_NAME, SAVE_OUTPUT, INSTANCE_OUTPUT_DIRECTORY and CURRENT_INSTANCE_NAME are at least necessary. See main.py for parameter explanations. Note that INSTANCE_OUTPUT_DIRECTORY and CURRENT_INSTANCE_NAME are set in the methods of run_algorithm.py.