Keras 2 API文档 / 回调 API / RemoteMonitor

RemoteMonitor

[源代码]

RemoteMonitor

tf_keras.callbacks.RemoteMonitor(
    root="https://:9000",
    path="/publish/epoch/end/",
    field="data",
    headers=None,
    send_as_json=False,
)

用于将事件流式传输到服务器的回调。

需要 requests 库。默认情况下,事件会发送到 root + '/publish/epoch/end/'。调用是 HTTP POST,并带有一个 data 参数,该参数是事件数据的 JSON 编码字典。如果 send_as_json=True,则请求的内容类型将是 "application/json"。否则,序列化后的 JSON 将在表单中发送。

参数

  • root: String;目标服务器的根 URL。
  • path: String;事件将发送到的相对于 root 的路径。
  • field: String;数据将存储在其下的 JSON 字段。当有效负载通过表单发送时(即 send_as_json 设置为 False),才会使用该字段。
  • headers: Dictionary;可选的自定义 HTTP 标头。
  • send_as_json: Boolean;请求是否应作为 "application/json" 发送。