Skip to content

Visualizations (tensorboard alternative)? #74

@jbrea

Description

@jbrea

Are there any plans to add some Julia-based visualization of the log files (as an alternative to tensorboard)?

I tried the following simple example for the log file of the usage example in the readme.
I think with @essenciary's Stipple.jl one could get something nice here.

using TensorBoardLogger, Genie, Genie.Router, Genie.Renderer.Html,
Stipple, StippleCharts, StippleCharts.Charts

function pushdata!(model, i, v)
    model.i = i
    push!(model.plot_data.val[1].plotdata.data, v)
end

function loaddata(path, var, model; timeout = 1)
    while true
        map_summaries((s, i, v) -> s == var ? pushdata!(model, i, v) : nothing,
                      path, steps = model.i + 1 : typemax(UInt))
        sleep(timeout)
    end
end

Base.@kwdef mutable struct Dashboard <: ReactiveModel
    i::Int = 0
    plot_option::PlotOptions = PlotOptions(chart_type = :scatter)
    plot_data::R{Vector{PlotSeries}} = [PlotSeries(name = "test/j",
                                                   plotdata = PlotData(Float32[]))]
end

Stipple.register_components(Dashboard, StippleCharts.COMPONENTS)
model = Stipple.init(Dashboard)

function ui()
  page(
    root(model), class="container", [
        row([
        cell(class="st-module", [
          h5("Series")
          plot(:plot_data; options = :plot_option)
        ])
      ])
    ], title="TBoardLogger"
  ) |> html
end

route("/", ui)

up()

loaddata("logs/run", "test/j", model) # no auto-refresh of the browser...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions