File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ cd metacal
11
11
poetry install
12
12
#+end_src
13
13
14
+
15
+
14
16
* usage
15
17
16
18
See the test code.
@@ -26,6 +28,38 @@ python test_metacal.py
26
28
: ECE: 0.005411952048287812, empirical coverageacc: 0.3377814845704754
27
29
28
30
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
+
29
63
* note
30
64
As we've mentioned in the main paper:
31
65
#+begin_quote
You can’t perform that action at this time.
0 commit comments