Skip to content

Commit 00f4adb

Browse files
authored
Merge branch 'JuliaLogging:master' into fix-MultilineChartContent-not-defined
2 parents 2ad5f15 + 37bae6b commit 00f4adb

File tree

134 files changed

+10970
-9796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+10970
-9796
lines changed

.github/workflows/UnitTest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: [macos-latest, ubuntu-latest]
16-
julia_version: ["1.3", "1", "nightly"]
16+
julia_version: ["1.6", "1", "nightly"]
1717

1818
runs-on: ${{ matrix.os }}
1919
env:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ test/test_logs
66
docs/Manifest.toml
77

88
gen/proto
9-
gen/protojl
9+
gen/protojl

Project.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TensorBoardLogger"
22
uuid = "899adc3e-224a-11e9-021f-63837185c80f"
33
authors = ["Filippo Vicentini <[email protected]>"]
4-
version = "0.1.20"
4+
version = "0.1.23"
55

66
[deps]
77
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
@@ -14,17 +14,20 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1414
[compat]
1515
FileIO = "1.2.3"
1616
ImageCore = "0.8.1, 0.9"
17-
ProtoBuf = "0.10, 0.11"
17+
ProtoBuf = "1.0.11"
1818
Requires = "0.5, 1"
19-
StatsBase = "0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33"
20-
julia = "1.3"
19+
StatsBase = "0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34"
20+
julia = "1.6"
2121

2222
[extras]
23-
Minio = "4281f0d9-7ae0-406e-9172-b7277c1efa20"
23+
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
24+
Fontconfig = "186bb1d3-e1f7-5a2c-a377-96d770f13627"
25+
Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004"
2426
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
2527
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
2628
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
2729
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458"
30+
Minio = "4281f0d9-7ae0-406e-9172-b7277c1efa20"
2831
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
2932
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
3033
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ logger in Julia:
3939

4040
You can log to TensorBoard any type. Numeric types will be logged as scalar,
4141
arrays will be binned into histograms, images and audio will be logged as such,
42-
and we even support [Plots](https://github.com/JuliaPlots/Plots.jl) and
43-
[PyPlot](https://github.com/JuliaPlots/Plots.jl) figures!
42+
and we even support [Plots](https://github.com/JuliaPlots/Plots.jl),
43+
[PyPlot](https://github.com/JuliaPlots/Plots.jl) and [Gadfly](https://github.com/GiovineItalia/Gadfly.jl) figures!
4444

4545
For details about how types are logged by default, or how to customize this behaviour for your custom types,
4646
refer to the documentation or the examples folder.
@@ -71,7 +71,7 @@ end
7171
```
7272

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

7777
## Roadmap

docs/make.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ makedocs(
1010
"Backends" => "custom_behaviour.md",
1111
"Reading back data" => "deserialization.md",
1212
"Extending" => "extending_behaviour.md",
13-
"Explicit Interface" => "explicit_interface.md"
13+
"Explicit Interface" => "explicit_interface.md",
14+
"Hyperparameter logging" => "hyperparameters.md"
1415
],
1516
"Examples" => Any[
1617
"Flux.jl" => "examples/flux.md"
1718
"Optim.jl" => "examples/optim.md"
19+
"Hyperparameter tuning" => "examples/hyperparameter_tuning.md"
1820
]
1921
],
2022
format = Documenter.HTML(

docs/src/custom_behaviour.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ value is sent to:
55

66
- `::AbstractVector{<:Real}` -> [Histogram backend](https://www.tensorflow.org/guide/tensorboard_histograms) as a vector
77
- `::StatsBase.Histogram` -> [Histogram backend](https://www.tensorflow.org/guide/tensorboard_histograms)
8-
- `(bin_edges, weights)::Tuple{AbstractVector,AbstractVector}` where `length(bin_edges)==length(weights)+1`, is interpreted as an histogram. (*Will be deprecated.* Please use `TBHistogram(edges, weights)` for this).
8+
<!-- - `(bin_edges, weights)::Tuple{AbstractVector,AbstractVector}` where `length(bin_edges)==length(weights)+1`, is interpreted as an histogram. (*Will be deprecated.* Please use `TBHistogram(edges, weights)` for this). -->
99
- `::Real` -> Scalar backend
1010
- `::AbstractArray{<:Colorant}` -> [Image backend](https://www.tensorflow.org/tensorboard/r2/image_summaries)
1111
- `::Any` -> Text Backend
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Hyperparameter tuning
2+
3+
We will start this example by setting up a simple random walk experiment, and seeing the effect of the hyperparameter `bias` on the results.
4+
5+
First, import the packages we will need with:
6+
```julia
7+
using TensorBoardLogger, Logging
8+
using Random
9+
```
10+
Next, we will create a function which runs the experiment and logs the results, include the hyperparameters stored in the `config` dictionary.
11+
```julia
12+
function run_experiment(id, config)
13+
logger = TBLogger("random_walk/run$id", tb_append)
14+
15+
# Specify all the metrics we want to track in a list
16+
metric_names = ["scalar/position"]
17+
write_hparams!(logger, config, metric_names)
18+
19+
epochs = config["epochs"]
20+
sigma = config["sigma"]
21+
bias = config["bias"]
22+
with_logger(logger) do
23+
x = 0.0
24+
for i in 1:epochs
25+
x += sigma * randn() + bias
26+
@info "scalar" position = x
27+
end
28+
end
29+
nothing
30+
end
31+
```
32+
Now we can write a script which runs an experiment over a set of parameter values.
33+
```julia
34+
id = 0
35+
for bias in LinRange(-0.1, 0.1, 11)
36+
for epochs in [50, 100]
37+
config = Dict(
38+
"bias"=>bias,
39+
"epochs"=>epochs,
40+
"sigma"=>0.1
41+
)
42+
run_experiment(id, config)
43+
id += 1
44+
end
45+
end
46+
```
47+
48+
Below is an example of the dashboard you get when you open Tensorboard with the command:
49+
```sh
50+
tensorboard --logdir=random_walk
51+
```
52+
53+
![tuning plot](tuning.png)

docs/src/examples/tuning.png

269 KB
Loading

docs/src/explicit_interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ See [TensorBoard Custom Scalar page](https://github.com/tensorflow/tensorboard/t
4444

4545
For example, to combine in the same plot panel the two curves logged under tags `"Curve/1"` and `"Curve/2"` you can run once the command:
4646
```julia
47-
layout = Dict("Cat" => Dict("Curve" => ("Multiline", ["Curve/1", "Curve/2"])))
47+
layout = Dict("Cat" => Dict("Curve" => (tb_multiline, ["Curve/1", "Curve/2"])))
4848

4949
log_custom_scalar(lg, layout)
5050

docs/src/extending_behaviour.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ At the end of this step, every pair in `objects` will be logged to a specific
1212
backend, according to the following rules:
1313

1414
- `::AbstractVector{<:Real}` -> [Histogram backend](https://www.tensorflow.org/guide/tensorboard_histograms) as a vector
15-
- `::Tuple{AbstractVector,AbstractVector}` [Histogram backend](https://www.tensorflow.org/guide/tensorboard_histograms) as an histogram
15+
<!-- - `::Tuple{AbstractVector,AbstractVector}` [Histogram backend](https://www.tensorflow.org/guide/tensorboard_histograms) as an histogram -->
1616
- `::Real` -> Scalar backend
1717
- `::AbstractArray{<:Colorant}` -> [Image backend](https://www.tensorflow.org/tensorboard/r2/image_summaries)
1818
- `::Any` -> Text Backend

0 commit comments

Comments
 (0)