MCPcopy Create free account
hub / github.com/alexrame/fishr / hparams_accs

Method hparams_accs

domainbed/model_selection.py:27–40  ·  view source on GitHub ↗

Given all records from a single (dataset, algorithm, test env) pair, return a sorted list of (run_acc, records) tuples.

(self, records)

Source from the content-addressed store, hash-verified

25
26 @classmethod
27 def hparams_accs(self, records):
28 """
29 Given all records from a single (dataset, algorithm, test env) pair,
30 return a sorted list of (run_acc, records) tuples.
31 """
32 return (records.group('args.hparams_seed')
33 .map(lambda _, run_records:
34 (
35 self.run_acc(run_records),
36 run_records
37 )
38 ).filter(lambda x: x[0] is not None)
39 .sorted(key=lambda x: x[0]['val_acc'])[::-1]
40 )
41
42 @classmethod
43 def sweep_acc(self, records):

Callers 2

sweep_accMethod · 0.95

Calls 5

run_accMethod · 0.95
sortedMethod · 0.80
filterMethod · 0.80
mapMethod · 0.80
groupMethod · 0.80

Tested by

no test coverage detected