Skip to content

Commit c138562

Browse files
committed
update readme
1 parent 7f29db7 commit c138562

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.org

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ cd metacal
1111
poetry install
1212
#+end_src
1313

14+
15+
1416
* usage
1517

1618
See the test code.
@@ -26,6 +28,38 @@ python test_metacal.py
2628
: ECE: 0.005411952048287812, empirical coverageacc: 0.3377814845704754
2729

2830

31+
* examples
32+
33+
An example on MNIST dataset can be found in =examples= folder. To generate the
34+
logits, the mnist training script (copied and adapted from the official
35+
pytorch repo) can be run using the following commands:
36+
37+
#+begin_src shell
38+
cd metacal/examples
39+
python main.py
40+
#+end_src
41+
42+
I already uploaded the generated logits in the same folder. To run MetaCal:
43+
#+begin_src sh
44+
python test_metacal.py --target_acc 0.999
45+
#+end_src
46+
47+
#+RESULTS:
48+
: Test MisCoverage (target=0.05)
49+
: ECE: 0.0032083215959369618, empirical miscoverage: 0.0502167994353131
50+
: Original test accuracy: 0.9917
51+
: Test CoverageAcc (target=0.999)
52+
: ECE: 0.0029820996381342496, empirical coverageacc: 0.9995717803233058
53+
54+
Another usage of MetaCal is that it can remove ambiguous examplers, to show
55+
this, I made two plots comparing the TSNE of the original logits and the
56+
logits returned by MetaCal. From the following figure, we can see MetaCal
57+
produces a very clean separation among 10 classes while the original TSNE has
58+
many wrongly located points.
59+
60+
[[./examples/TSNE-metacal.jpg]]
61+
62+
2963
* note
3064
As we've mentioned in the main paper:
3165
#+begin_quote

0 commit comments

Comments
 (0)