Accumulates event values collected from the provided path.
Event file reader.
Event file reader.
An event file reader is used to create iterators over the events stored in the file at the provided path (i.e.,
filePath
).
Note that this reader ignores any corrupted records at the end of the file. That is to allow for "live tracking" of summary files while they're being written to.
Writes Event
protocol buffers to files.
Writes Event
protocol buffers to files.
The EventFileWriter
class creates an event file in the specified directory and asynchronously writes Event
protocol buffers to it. The file is encoded using the TFRecord
format, which is similar to RecordIO
.
On construction the event file writer creates a new event file in workingDir
. This event file will contain Event
protocol buffers, which are written to disk via the EventFileWriter.write()
method.
An EventMultiplexer manages access to multiple EventAccumulators.
An EventMultiplexer manages access to multiple EventAccumulators.
Each event accumulator is associated with a run
, which is a self-contained execution. The event multiplexer
provides methods for extracting information about events from multiple run
s.
Example usage for loading specific runs from files:
val m = EventMultiplexer(Map("run1" -> Paths.get("path/to/run1"), "run2" -> Paths.get("path/to/run2"))) m.reload()
Example usage for loading a directory where each subdirectory corresponds to a run:
// For example, assume the following directory structure: // /parent/directory/path/ // /parent/directory/path/run1/ // /parent/directory/path/run1/events.out.tfevents.1001 // /parent/directory/path/run1/events.out.tfevents.1002 // /parent/directory/path/run2/ // /parent/directory/path/run2/events.out.tfevents.9232 // /parent/directory/path/run3/ // /parent/directory/path/run3/events.out.tfevents.9232 val m1 = EventMultiplexer().addRunsFromDirectory("/parent/directory/path") // is equivalent to: val m2 = EventMultiplexer(Map("run1" -> Paths.get("/parent/directory/path/run1", ...)))
Optional map containing the initial run name to path mapping.
Information on how much data each event accumulator should store in memory. The
default size guidance tries not to store too much so as to avoid consuming all of
the client's memory. The sizeGuidance
should be a map from event types to integers
representing the number of items to keep in memory, per tag for items of that event
type. If the size is 0
, then all events are stored. Images, audio, and histograms
tend to be very large and thus storing all of them is not recommended.
Information on how each event accumulator should compress histogram data for the CompressedHistogramEventType event type.
Boolean value indicating whether to discard any events that were "orphaned" by a TensorFlow restart.
Writes Summary
protocol buffers to event files for use with TensorBoard.
Writes Summary
protocol buffers to event files for use with TensorBoard.
The SummaryFileWriter class provides a mechanism to create an event file in a given directory and add summaries and events to it. The class updates the file contents asynchronously. This allows a training program to call methods to add data to the file directly from the training loop, without slowing down training.
On construction the summary writer creates a new event file in workingDir
. This event file will contain Event
protocol buffers constructed when you call one of the following functions: writeGraph()
, writeSummary()
,
writeSessionLog()
, or writeRunMetadata()
.
If you pass a Graph
to the constructor it is write to the event file, which is equivalent to calling
writeGraph()
later on.
TensorBoard will pick up the graph from the file and display it graphically so you can interactively explore it. You will usually pass the graph from the session in which you launched it:
// Create a graph. val graph = Graph() ... // Launch the graph in a session. val session = Session(graph) // Create a summary file writer and add the graph to the event file. val writer = SummaryWriter(workingDir, session.graph)
Contains utilities for managing event plugins (e.g., TensorBoard plugins).
Cache for summary file writers, which caches one writer per directory.
Accumulates event values collected from the provided path.
The EventAccumulator is intended to provide a convenient interface for loading event data written during a TensorFlow run (or otherwise). TensorFlow writes out event ProtoBuf objects, which have a timestamp and step number associated with them, and often also contain a Summary. Summaries can store different kinds of data like a scalar value, an image, audio, or a histogram. Each summary also has a tag associated with it, which we use to organize logically related data. The EventAccumulator supports retrieving the event and summary data by their tags.
Calling
tags
returns a map from event types to the associated tags for those types, that were found in the loaded event files. Then, various functional endpoints (e.g.,scalars(tag)
) allow for the retrieval of all data associated with each tag.The
reload()
method synchronously loads all of the data written so far.Path to a directory containing TensorFlow events files, or a single TensorFlow events file. The accumulator will load events from this path.
Information on how much data the event accumulator should store in memory. The default size guidance tries not to store too much so as to avoid consuming all of the client's memory. The
sizeGuidance
should be a map from event types to integers representing the number of items to keep in memory, per tag for items of that event type. If the size is0
, then all events are stored. Images, audio, and histograms tend to be very large and thus storing all of them is not recommended.Information on how the event accumulator should compress histogram data for the CompressedHistogramEventType event type.
Boolean value indicating whether to discard any events that were "orphaned" by a TensorFlow restart.