tensorflow

Platypush documentation

tensorflow#

class platypush.message.event.tensorflow.TensorflowBatchEndedEvent(batch: int, *args, **kwargs)[source]#

Bases: TensorflowEvent

Triggered when a the processing of a Tensorflow model training/evaluation batch ends.

__init__(batch: int, *args, **kwargs)[source]#
Parameters:

batch – Batch index.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.tensorflow.TensorflowBatchStartedEvent(batch: int, *args, **kwargs)[source]#

Bases: TensorflowEvent

Triggered when a Tensorflow model training/evaluation batch starts being processed.

__init__(batch: int, *args, **kwargs)[source]#
Parameters:

batch – Batch index.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.tensorflow.TensorflowEpochEndedEvent(epoch: int, *args, **kwargs)[source]#

Bases: TensorflowEvent

Triggered when a Tensorflow model training/evaluation epoch ends.

__init__(epoch: int, *args, **kwargs)[source]#
Parameters:

epoch – Epoch index.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.tensorflow.TensorflowEpochStartedEvent(epoch: int, *args, **kwargs)[source]#

Bases: TensorflowEvent

Triggered when a Tensorflow model training/evaluation epoch begins.

__init__(epoch: int, *args, **kwargs)[source]#
Parameters:

epoch – Epoch index.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.tensorflow.TensorflowEvent(model: str, logs: Dict[str, int | float] | None, *args, **kwargs)[source]#

Bases: Event

__init__(model: str, logs: Dict[str, int | float] | None, *args, **kwargs)[source]#
Parameters:
  • model – Name of the Tensorflow model.

  • logs – Logs and metrics.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.tensorflow.TensorflowTrainEndedEvent(model: str, logs: Dict[str, int | float] | None, *args, **kwargs)[source]#

Bases: TensorflowEvent

Triggered when the training phase of a Tensorflow model ends.

__init__(model: str, logs: Dict[str, int | float] | None, *args, **kwargs)#
Parameters:
  • model – Name of the Tensorflow model.

  • logs – Logs and metrics.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.tensorflow.TensorflowTrainStartedEvent(model: str, logs: Dict[str, int | float] | None, *args, **kwargs)[source]#

Bases: TensorflowEvent

Triggered when a Tensorflow model starts being trained.

__init__(model: str, logs: Dict[str, int | float] | None, *args, **kwargs)#
Parameters:
  • model – Name of the Tensorflow model.

  • logs – Logs and metrics.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object