Source code for platypush.message.event.tensorflow
from typing import Optional, Dict, Union
from platypush.message.event import Event
[docs]
class TensorflowEvent(Event):
[docs]
def __init__(self, model: str, logs: Optional[Dict[str, Union[int, float]]], *args, **kwargs):
"""
:param model: Name of the Tensorflow model.
:param logs: Logs and metrics.
"""
super().__init__(*args, model=model, logs=logs, **kwargs)
[docs]
class TensorflowEpochStartedEvent(TensorflowEvent):
"""
Triggered when a Tensorflow model training/evaluation epoch begins.
"""
[docs]
def __init__(self, epoch: int, *args, **kwargs):
"""
:param epoch: Epoch index.
"""
super().__init__(*args, epoch=epoch, **kwargs)
[docs]
class TensorflowEpochEndedEvent(TensorflowEvent):
"""
Triggered when a Tensorflow model training/evaluation epoch ends.
"""
[docs]
def __init__(self, epoch: int, *args, **kwargs):
"""
:param epoch: Epoch index.
"""
super().__init__(*args, epoch=epoch, **kwargs)
[docs]
class TensorflowBatchStartedEvent(TensorflowEvent):
"""
Triggered when a Tensorflow model training/evaluation batch starts being processed.
"""
[docs]
def __init__(self, batch: int, *args, **kwargs):
"""
:param batch: Batch index.
"""
super().__init__(*args, batch=batch, **kwargs)
[docs]
class TensorflowBatchEndedEvent(TensorflowEvent):
"""
Triggered when a the processing of a Tensorflow model training/evaluation batch ends.
"""
[docs]
def __init__(self, batch: int, *args, **kwargs):
"""
:param batch: Batch index.
"""
super().__init__(*args, batch=batch, **kwargs)
[docs]
class TensorflowTrainStartedEvent(TensorflowEvent):
"""
Triggered when a Tensorflow model starts being trained.
"""
[docs]
class TensorflowTrainEndedEvent(TensorflowEvent):
"""
Triggered when the training phase of a Tensorflow model ends.
"""
# vim:sw=4:ts=4:et: