Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace ImageNet ensemble baseline with Robustness Metrics.
There are two approaches to implement ensembles. 1. Load all SavedModels into a single model. + Pro: Simple to compute results. + Con: All models must fit in memory and compute can't parallelize across models. 2. Eval each model in parallel, saving predictions. Then load predictions and compute metrics. (approach in Uncertainty Baselines) + Pro: Scales with compute and memory. + Con: Requires two stages (the first uses accelerators, the second is CPU-only). We're already doing the first stage to report non-ensemble results. So two stages is not that inconvenient. This CL does #2. Fixes google/uncertainty-baselines#63, google/uncertainty-baselines#71. Note: I added 'ece' back to the imagenet_variants report. TODOs in later PRs + Loading predictions is slow. Each file is at most 200MB with 50K predictions of 1000 float32 values, and read_predictions shouldn't take this long. np.load gets, say, read speeds of 200 MB/s (https://stackoverflow.com/a/30332316). It may be because we're loading batch_size=1? + Replace het_ensemble.py and sngp_ensemble.py. PiperOrigin-RevId: 370938990
- Loading branch information