Bases: EmbeddingModelOperationalMetric
Vectors produced per second over this run.
Example:
program.compile(
metrics=[
synalinks.metrics.EmbeddingVectorsPerSecond(),
],
)
Source code in synalinks/src/metrics/em_metrics.py
| @synalinks_export("synalinks.metrics.EmbeddingVectorsPerSecond")
class EmbeddingVectorsPerSecond(EmbeddingModelOperationalMetric):
"""Vectors produced per second over this run.
Example:
```python
program.compile(
metrics=[
synalinks.metrics.EmbeddingVectorsPerSecond(),
],
)
```
"""
def __init__(self, name="embedding_vectors_per_second"):
super().__init__(name=name)
def result(self):
wall = self._wall_clock_delta()
if wall <= 0.0:
return 0.0
return self._delta("vectors") / wall
|