for alg in algs:
  write_data_points_to_file(time_results[alg],
                            plot_time_data_filename(tmpdir, alg),
                            'snr', 'time')
  write_data_points_to_file(topk_l1_results[alg],
                            plot_topk_l1_error_per_entry_data_filename(tmpdir,
                                alg),
                            'snr', 'topk_l1_error_per_entry')
  write_data_points_to_file(relative_l2_l2_results[alg],
                            plot_relative_l2_l2_error_data_filename(tmpdir,
                                alg), 'snr', 'relative_l2_l2_error')
# Matplotlib
if plot:
  plt.figure(1)
  for alg in algs:
    plot_data_points(time_results[alg], plt, alg, '-x')
  plt.loglog(basex=10)
  plt.xlabel('SNR')
  plt.ylabel('time (s)')
  plt.legend()

  plt.figure(2)
  for alg in algs:
    plot_data_points(topk_l1_results[alg], plt, alg, '-x')
  plt.semilogx(basex=10)
  plt.xlabel('SNR')
  plt.ylabel('top-k l1 error per entry')
  plt.legend()

  plt.figure(3)
  for alg in algs:
print "Time results:\n"
print time_results
print "\n\nl0-error results:\n"
print l0_results
print "\n\nSuccess results:\n"
print success_results

# pgfplot files
for alg in algs:
    write_data_points_to_file(time_results[alg], plot_time_data_filename(tmpdir, alg), "k", "time")
    write_data_points_to_file(l0_results[alg], plot_l0_error_data_filename(tmpdir, alg), "k", "l0_error")
# Matplotlib
if plot:
    plt.figure(1)
    for alg in algs:
        plot_data_points(time_results[alg], plt, alg, "-x")
    plt.loglog(basex=10)
    plt.xlabel("k")
    plt.ylabel("time (s)")
    plt.legend()

    plt.figure(2)
    for alg in algs:
        plot_data_points(l0_results[alg], plt, alg, "x")
    plt.semilogx(basex=10)
    plt.xlabel("k")
    plt.ylabel("l0 error (l0-epsilon: {:e})".format(l0_eps))
    plt.legend()

    plt.show()
Esempio n. 3
0
print '\n\nSuccess results:\n'
print success_results

# pgfplot files
for alg in algs:
    write_data_points_to_file(time_results[alg],
                              plot_time_data_filename(tmpdir, alg), 'k',
                              'time')
    write_data_points_to_file(l0_results[alg],
                              plot_l0_error_data_filename(tmpdir, alg), 'k',
                              'l0_error')
# Matplotlib
if plot:
    plt.figure(1)
    for alg in algs:
        plot_data_points(time_results[alg], plt, alg, '-x')
    plt.loglog(basex=10)
    plt.xlabel('k')
    plt.ylabel('time (s)')
    plt.legend()

    plt.figure(2)
    for alg in algs:
        plot_data_points(l0_results[alg], plt, alg, 'x')
    plt.semilogx(basex=10)
    plt.xlabel('k')
    plt.ylabel('l0 error (l0-epsilon: {:e})'.format(l0_eps))
    plt.legend()

    plt.show()
print '\n\nSuccess results:\n'
print success_results

# pgfplot files
for alg in algs:
  write_data_points_to_file(time_results[alg],
                            plot_time_data_filename(tmpdir, alg),
                            'k', 'time')
  write_data_points_to_file(l0_results[alg],
                            plot_l0_error_data_filename(tmpdir, alg),
                            'k', 'l0_error')
# Matplotlib
if plot:
  plt.figure(1)
  for alg in algs:
    plot_data_points(time_results[alg], plt, alg, '-x')
  plt.loglog(basex=10)
  plt.xlabel('k')
  plt.ylabel('time (s)')
  plt.legend()

  plt.figure(2)
  for alg in algs:
    plot_data_points(l0_results[alg], plt, alg, 'x')
  plt.semilogx(basex=10)
  plt.xlabel('k')
  plt.ylabel('l0 error (l0-epsilon: {:e})'.format(l0_eps))
  plt.legend()

  plt.show()