SummaryWriter

public struct SummaryWriter

A writer for writing model execution summaries to a tensorboard-readable file; the summaries include scalars for logging statistics, graphs for visualizing model etc.

  • Creates an instance with log located at logDirectory.

    Declaration

    Swift

    public init(logDirectory: String)
  • Declaration

    Swift

    public func close() throws
  • Add training and validation statistics for tensorboard scalars dashboard.

    Declaration

    Swift

    public func addScalar(
      _ tag: String, _ value: Float, step: Int,
      wallTime: Double = Date().timeIntervalSince1970, displayName: String? = nil,
      description: String? = nil
    )
  • Add tensor for tensorboard histograms dashboard.

    Declaration

    Swift

    public func addHistogram(
      _ tag: String, _ value: Tensor<Float>, step: Int,
      wallTime: Double = Date().timeIntervalSince1970, displayName: String? = nil,
      description: String? = nil
    )
  • Add tensor for tensorboard images dashboard.

    Declaration

    Swift

    public func addImage(
      _ tag: String, _ value: Tensor<Float>, step: Int,
      wallTime: Double = Date().timeIntervalSince1970, displayName: String? = nil,
      description: String? = nil
    )
  • Add graph for tensorboard graphs dashboard.

    Declaration

    Swift

    public func addGraph(
      _ tag: String, _ value: Model, step: Int,
      wallTime: Double = Date().timeIntervalSince1970, displayName: String? = nil,
      description: String? = nil
    )