| 17 | |
| 18 | |
| 19 | class 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 | |
| 29 | class LoggingOptimizer(base.Optimizer): |
no outgoing calls
searching dependent graphs…