7a8be4139a3d1f3968081728375c4621285ec3fe,unrestricted_advex/eval_kit/eval_with_attacks.py,,plot_confident_error_rate,#,145

Before Change


    ax = fig.add_subplot(111)

    plt.plot(coverages, [float(len(idxs)) / num_examples
                         for idxs in cov_to_confident_error_idxs])
    plt.title(title.format(attack_name=attack_name))
    plt.ylabel("Risk \n (error rate on covered data)")
    plt.xlabel("Coverage \n (fraction of points not abstained on)")

After Change


  fig = plt.figure()
  ax = fig.add_subplot(111)

  cov_to_num_covered_examples = [
    num_examples * coverage for coverage in coverages
  ]

  risk_on_covered_data = [
    float(len(error_idxs)) / num_covered_examples
    for error_idxs, num_covered_examples in
    zip(cov_to_confident_error_idxs, cov_to_num_covered_examples)]

  plt.plot(coverages, risk_on_covered_data)
  plt.title(title.format(attack_name=attack_name))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: google/unrestricted-adversarial-examples
Commit Name: 7a8be4139a3d1f3968081728375c4621285ec3fe
Time: 2018-08-25
Author: nottombrown@gmail.com
File Name: unrestricted_advex/eval_kit/eval_with_attacks.py
Class Name:
Method Name: plot_confident_error_rate


Project Name: autoreject/autoreject
Commit Name: e6dc6899d0aa846636c48562c79b161347c35235
Time: 2019-06-04
Author: mainakjas@gmail.com
File Name: autoreject/ransac.py
Class Name: Ransac
Method Name: fit


Project Name: tensorflow/agents
Commit Name: aaafecb49e4eb1764f58a9b0a47e2941983c9bc6
Time: 2021-02-04
Author: ebrevdo@google.com
File Name: tf_agents/networks/sequential.py
Class Name: Sequential
Method Name: __init__