MCPcopy
hub / github.com/facebookresearch/nevergrad / CounterFunction

Class CounterFunction

nevergrad/optimization/test_base.py:19–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18
19class CounterFunction:
20 def __init__(self) -> None:
21 self.count = 0
22
23 def __call__(self, value: tp.ArrayLike) -> float:
24 assert len(value) == 1
25 self.count += 1
26 return float(value[0] - 1) ** 2
27
28
29class LoggingOptimizer(base.Optimizer):

Callers 3

test_sequential_executorFunction · 0.85
test_optimize_and_dumpFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_sequential_executorFunction · 0.68
test_optimize_and_dumpFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…