Giter Club home page Giter Club logo

tensorboardlogger.jl's Introduction

TensorBoardLogger

codecov

TensorBoardLogger.jl is a native library for logging arbitrary data to Tensorboard, extending Julia's standard Logging framework. It can also be used to deserialize TensoBoard's .proto files.

Many ideas are taken from UniversalTensorBoard and from TensorBoardX. It is based on ProtoBuf.jl.

Installation

To install run the following command in the julia REPL:

] add TensorBoardLogger

If you need to log Images, you must also install ImageMagick (on MacOS, you will also need QuartzImageIO).

] add ImageMagick

Usage

The fundamental type defined in this package is a TBLogger, which behaves like other standard loggers in Julia such as ConsoleLogger or TextLogger. You can create one by passing it the path to the folder where you want to store the data. You can also pass an optional second argument to specify the behaviour in case there already exists a document at the given path.

Once you have created a TBLogger, you can use it as you would use any other logger in Julia:

  • You can set it to be your global logger with the function global_logger
  • You can set it to be the current logger in a scope with the function with_logger
  • You can combine it with other Loggers using LoggingExtras.jl, so that messages are logged to TensorBoard and to other backends at the same time.

You can log to TensorBoard any type. Numeric types will be logged as scalar, arrays will be binned into histograms, images and audio will be logged as such, and we even support Plots and PyPlot figures!

For details about how types are logged by default, or how to customize this behaviour for your custom types, refer to the documentation or the examples folder.

using TensorBoardLogger, Logging, Random

lg=TBLogger("tensorboard_logs/run", min_level=Logging.Info)

struct sample_struct first_field; other_field; end

with_logger(lg) do
    for i=1:100
        x0          = 0.5+i/30; s0 = 0.5/(i/20);
        edges       = collect(-5:0.1:5)
        centers     = collect(edges[1:end-1] .+0.05)
        histvals    = [exp(-((c-x0)/s0)^2) for c=centers]
        data_tuple  = (edges, histvals)
        data_struct = sample_struct(i^2, i^1.5-0.3*i)


        @info "test" i=i j=i^2 dd=rand(10).+0.1*i hh=data_tuple
        @info "test_2" i=i j=2^i hh=data_tuple log_step_increment=0
        @info "" my_weird_struct=data_struct   log_step_increment=0
        @debug "debug_msg" this_wont_show_up=i
    end
end

Integration with third party packages

We also support native logging of the types defined by a few third-party packages, such as Plots and PyPlot plots. If there are other libraries that you think we should include in the list, please open an issue.

Roadmap

Support for Computational Graphs is currently planned and partly implemented.

Contributions are welcome! You can get in touch by opening an issue, sending me an email or on slack (@PhilipVinc).

tensorboardlogger.jl's People

Contributors

philipvinc avatar oxinabox avatar github-actions[bot] avatar fissoreg avatar ericphanson avatar jamiemair avatar eggiverse avatar touchesir avatar carlolucibello avatar ancapdev avatar jjminton avatar johnnychen94 avatar juliatagbot avatar findmyway avatar xukai92 avatar darsnack avatar visr avatar maximebouton avatar rustyconover avatar ssfrr avatar tkf avatar natema avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.