debug.py 550 B

1234567891011121314151617181920
  1. import numpy as np
  2. from pylab import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show,semilogx, semilogy
  3. from numpy import genfromtxt
  4. ref_data = genfromtxt('input_example3.txt', delimiter=',')
  5. figure()
  6. plot(ref_data)
  7. output_data = genfromtxt('../build/output_example3.txt', delimiter=',')
  8. plot(output_data)
  9. show()
  10. print(ref_data.shape)
  11. print(output_data.shape)
  12. nb = output_data.shape[0] - 128
  13. print("Comparison of input and output : max absolute error")
  14. diff = output_data[128:] - ref_data[:nb]
  15. print(np.max(np.abs(diff)))