From f5e6828a0673d94ca8b3b96957480e7d36e65d4f Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Tue, 28 Dec 2021 13:37:52 +0100 Subject: [PATCH] several small documentation fixes Some documentation syntax, some spelling. --- docs/src/custom_behaviour.md | 2 +- docs/src/deserialization.md | 2 +- docs/src/examples/flux.md | 2 +- docs/src/explicit_interface.md | 2 +- docs/src/index.md | 8 ++++---- src/Deserialization/histograms.jl | 2 +- src/Deserialization/lookahead.jl | 2 +- src/Loggers/LogCustomScalar.jl | 4 ++-- src/Loggers/LogValue.jl | 2 +- src/PNG.jl | 2 +- src/TBLogger.jl | 10 +++++----- src/logger_dispatch_overrides.jl | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/src/custom_behaviour.md b/docs/src/custom_behaviour.md index ee76a9ea..f3a2d8ad 100644 --- a/docs/src/custom_behaviour.md +++ b/docs/src/custom_behaviour.md @@ -1,6 +1,6 @@ # Specifying a backend -By default TensorBoardLogger follows those rules to chose what backend a certain +By default TensorBoardLogger follows these rules to choose what backend a certain value is sent to: - `::AbstractVector{<:Real}` -> [Histogram backend](https://www.tensorflow.org/guide/tensorboard_histograms) as a vector diff --git a/docs/src/deserialization.md b/docs/src/deserialization.md index d4405230..8506f842 100644 --- a/docs/src/deserialization.md +++ b/docs/src/deserialization.md @@ -27,7 +27,7 @@ If you want to read data that have been saved previously, you can also construct Alternatively, you can use the method [`map_summaries`](@ref) to iterate a function of your choice among the data contained in a logger. This function takes two arguments: a function and the path/`TBLogger` to the data. -The function is mapped across all logged summaries. It's signature should be +The function is mapped across all logged summaries. Its signature should be `fun(tag, iteration, value)`, where tag is a `String` with the tag used to serialize the data, `iteration` is an `Int` corresponding to the iteration at which the data was serialized, and `value` is the serialized value. An attempt is made to reconstruct as much as possible the original data, but in the serialization process data is usually converted to lower precision and compressed, so sometimes it's not the case. diff --git a/docs/src/examples/flux.md b/docs/src/examples/flux.md index b030866e..43d27f47 100644 --- a/docs/src/examples/flux.md +++ b/docs/src/examples/flux.md @@ -1,5 +1,5 @@ # Using TensorBoard with [Flux](https://fluxml.ai) -For a Google Colab version of this example, go [here](https://colab.research.google.com/drive/1xfUsBn9GEqbRjBF-UX_jnGjHZNtNsMae) +For a Google Colab version of this example, go [here](https://colab.research.google.com/drive/1xfUsBn9GEqbRjBF-UX_jnGjHZNtNsMae). The most important part of the example is the callback `TBCallback` which handles logging to TensorBoard. diff --git a/docs/src/explicit_interface.md b/docs/src/explicit_interface.md index 19471598..2a00c4b1 100644 --- a/docs/src/explicit_interface.md +++ b/docs/src/explicit_interface.md @@ -2,7 +2,7 @@ in addition to the standard logging interface, it is possible to log data to TensorBoard using the functions documented below. -All the functions accept take as first argument a `TBLogger` object +All the functions take as first argument a `TBLogger` object and as the second argument a `String` as the tag under which the data will be logged. diff --git a/docs/src/index.md b/docs/src/index.md index 4c4da5eb..9102b45a 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -91,8 +91,8 @@ end When you log data to tensorboard, it is processed to convert it to the format used by TensorBoard. -In particoular, fields in structures are logged individually individually and complex -numbers/arrays are split into their real and imaginary parts. Depending on it's type, an +In particular, fields in structures are logged individually and complex +numbers/arrays are split into their real and imaginary parts. Depending on its type, an object is serialized to the relevant backend, with the text backend being the default fallback. @@ -116,6 +116,6 @@ We also support logging custom types from a the following third-party libraries: ## Explicit logging -In alternative, you can also log data to TensorBoard through it's functional interface, +In alternative, you can also log data to TensorBoard through its functional interface, by calling the relevant method with a tag string and the data. For information -on this interface refer to [Explicit interface]@ref()... +on this interface refer to [Explicit interface](@ref)... diff --git a/src/Deserialization/histograms.jl b/src/Deserialization/histograms.jl index 323584a5..b7b95f43 100644 --- a/src/Deserialization/histograms.jl +++ b/src/Deserialization/histograms.jl @@ -29,7 +29,7 @@ function lookahead_deserialize_histogram_summary(old_tag, old_val, evs::Summary, res = iterate(evs, state + 1) res == nothing && return result - # if the next event is identified, check it's type + # if the next event is identified, check its type (new_tag, summary), i_state = res typ = summary_type(summary) diff --git a/src/Deserialization/lookahead.jl b/src/Deserialization/lookahead.jl index 08f4c2be..71af3be3 100644 --- a/src/Deserialization/lookahead.jl +++ b/src/Deserialization/lookahead.jl @@ -54,7 +54,7 @@ function lookahead_deserialize_simple_value_summary(old_tag, old_val, evs::Summa res = iterate(evs, state + 1) res == nothing && return result - # if the next event is identified, check it's type + # if the next event is identified, check its type (new_tag, summary), i_state = res typ = summary_type(summary) diff --git a/src/Loggers/LogCustomScalar.jl b/src/Loggers/LogCustomScalar.jl index 5173ef0b..4103a359 100644 --- a/src/Loggers/LogCustomScalar.jl +++ b/src/Loggers/LogCustomScalar.jl @@ -2,7 +2,7 @@ @enum tb_chart_type tb_multiline=1 tb_margin=2 """ -log_custom_scalar(logger, layout::AbstractDict; step = step(logger)) + log_custom_scalar(logger, layout::AbstractDict; step = step(logger)) Groups multiple scalars in the same plot to be visualized by the CUSTOM_SCALARS plugin. Note that this function sets the metadata: the actual values must be @@ -10,7 +10,7 @@ logged separately with `log_value` and referenced with the correct tag. The `layout` argument is structured as follows: -layout = Dict(category => Dict(name => (chart_type, [tag1, tag2, ...]))) + layout = Dict(category => Dict(name => (chart_type, [tag1, tag2, ...]))) where `category` is the main tag for the plot, `name` is the plot's name, `chart_type` is one between `tb_multiline` and `tb_margin` and the array of tags diff --git a/src/Loggers/LogValue.jl b/src/Loggers/LogValue.jl index 9f85e9dc..91152e89 100644 --- a/src/Loggers/LogValue.jl +++ b/src/Loggers/LogValue.jl @@ -1,7 +1,7 @@ """ log_value(logger, name, value; step=step(logger)) -Logs a Floating-point variable with name `name` at step `step`. +Logs a floating-point variable with name `name` at step `step`. If `value` is a complex number, the real and imaginary part are logged separately. """ diff --git a/src/PNG.jl b/src/PNG.jl index 2cd1c68f..b70e5d1d 100644 --- a/src/PNG.jl +++ b/src/PNG.jl @@ -12,7 +12,7 @@ include("FileIO_workaround.jl") """ PngImage -A wrapper around the binary encoding of a PNG image, holding it's attributes +A wrapper around the binary encoding of a PNG image, holding its attributes """ struct PngImage attr::Dict diff --git a/src/TBLogger.jl b/src/TBLogger.jl index 4cde028d..a3cf9cd6 100644 --- a/src/TBLogger.jl +++ b/src/TBLogger.jl @@ -62,8 +62,8 @@ Creates a folder at path `logdir`. If the folder already exhists the behaviour is determined by `overwrite`. - `overwrite=tb_increment` appends an increasing number 1,2... to logdir. - - `overwrite=tb_overwrite` overwrites the folder, deleting it's content. - - `overwrite=tb_append` appends to it's previous content. + - `overwrite=tb_overwrite` overwrites the folder, deleting its content. + - `overwrite=tb_append` appends to its previous content. """ function init_logdir(logdir, overwrite=tb_increment) if overwrite == tb_overwrite @@ -122,9 +122,9 @@ function create_eventfile(logdir, purge_step=nothing, time=time(); prepend="") end """ - add_eventfile(lg::TBLogger, path::String) + add_eventfile(lg::TBLogger, path::String) -Adds an event file to `lg` with `path` prepended to it's name. It can be used +Adds an event file to `lg` with `path` prepended to its name. It can be used to create sub-event collection in a single event collection. """ function add_eventfile(lg::TBLogger, path="") @@ -198,7 +198,7 @@ step(lg::TBLogger) = lg.global_step """ reset!(lg) -Reset the TBLogger `lg`, deleting everything in it's log directory. +Reset the TBLogger `lg`, deleting everything in its log directory. """ function reset!(lg::TBLogger) # close open streams diff --git a/src/logger_dispatch_overrides.jl b/src/logger_dispatch_overrides.jl index 1eb4af1c..dcd2c559 100644 --- a/src/logger_dispatch_overrides.jl +++ b/src/logger_dispatch_overrides.jl @@ -17,7 +17,7 @@ Returns the wrapped data inside of `x`. """ content(x::WrapperLogType) = @error "You should define `content($(typeof(x)))`" -# When we hit a wrapped type, we dispatch based on it's type. +# When we hit a wrapped type, we dispatch based on its type. preprocess(name, val::WrapperLogType, data) = push!(data, name=>val) # When logging to text or console, unwrap the LogType to fix formatting.