MCPcopy
hub / github.com/google-deepmind/acme / increment

Method increment

acme/utils/counting.py:63–77  ·  view source on GitHub ↗

Increment a set of counters. Args: **counts: keyword arguments specifying count increments. Returns: The [name, value] mapping of all counters stored, i.e. this will also include counts that were not updated by this call to increment.

(self, **counts: Number)

Source from the content-addressed store, hash-verified

61 self._return_only_prefixed = return_only_prefixed
62
63 def increment(self, **counts: Number) -> Dict[str, Number]:
64 """Increment a set of counters.
65
66 Args:
67 **counts: keyword arguments specifying count increments.
68
69 Returns:
70 The [name, value] mapping of all counters stored, i.e. this will also
71 include counts that were not updated by this call to increment.
72 """
73 with self._lock:
74 for key, value in counts.items():
75 self._counts.setdefault(key, 0)
76 self._counts[key] += value
77 return self.get_counts()
78
79 def get_counts(self) -> Dict[str, Number]:
80 """Return all counts tracked by this counter."""

Callers 15

test_counter_cachingMethod · 0.95
test_shared_countsMethod · 0.95
mainFunction · 0.95
mainFunction · 0.95
run_episodeMethod · 0.80
add_to_counterMethod · 0.80
get_countsMethod · 0.80
run_episodeMethod · 0.80
stepMethod · 0.80
stepMethod · 0.80
stepMethod · 0.80

Calls 2

get_countsMethod · 0.95
itemsMethod · 0.80

Tested by 4

test_counter_cachingMethod · 0.76
test_shared_countsMethod · 0.76
add_to_counterMethod · 0.64