relative_l2_l2_results[alg][snr] = make_data_point(l2_l2_errors,
        relative_l2_l2_error_percentile_high,
        relative_l2_l2_error_percentile_low)

print '\n'
print 'Time results:\n'
print time_results
print '\n\naverage top-k l1-error results:\n'
print topk_l1_results
print '\n\nRelative l2/l2 errors:\n'
print relative_l2_l2_results

# pgfplot files
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')
        time_results[alg][k] = make_data_point(times, time_percentile_low, time_percentile_high)
        l0_errors = extract_l0_errors(r)
        l0_results[alg][k] = make_data_point(l0_errors, l0_error_percentile_low, l0_error_percentile_high)
        success_results[alg][k] = float(num_l0_correct(r)) / (num_instances * num_trials)

print "\n"
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)
Esempio n. 3
0
                                             l0_error_percentile_high)
        success_results[alg][k] = float(num_l0_correct(r)) \
                                      / (num_instances * num_trials)

print '\n'
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)
                                         l0_error_percentile_high)
    success_results[alg][k] = float(num_l0_correct(r)) \
                                  / (num_instances * num_trials)

print '\n'
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)