Class LogFileWriter


  • public class LogFileWriter
    extends Object
    • Method Detail

      • writeGraphStructure

        public long writeGraphStructure​(SameDiff sd)
                                 throws IOException
        Write the graph structure
        Parameters:
        sd - SameDiff instance to write the graph structure for
        Returns:
        Number of bytes written
        Throws:
        IOException
      • writeFinishStaticMarker

        public long writeFinishStaticMarker()
                                     throws IOException
        Write marker for final static data
        Returns:
        Throws:
        IOException
      • readEvents

        public List<Pair<UIEvent,​com.google.flatbuffers.Table>> readEvents​(long startOffset)
                                                                          throws IOException
        Read all of the events starting at a specific file offset
        Returns:
        All of the UI events
        Throws:
        IOException
      • registeredEventName

        public boolean registeredEventName​(String name)
      • registerEventNameQuiet

        public long registerEventNameQuiet​(String name)
      • registerEventName

        public long registerEventName​(String name)
                               throws IOException
        Register the event name - "accuracy", "loss", etc for later use in recording events.
        Parameters:
        name - Name to register
        Returns:
        Number of bytes written
        Throws:
        IOException
      • writeScalarEvent

        public long writeScalarEvent​(String name,
                                     LogFileWriter.EventSubtype subtype,
                                     long time,
                                     int iteration,
                                     int epoch,
                                     Number scalar)
                              throws IOException
        Write a single scalar event to the file
        Parameters:
        name - Name of the event. Must be registered by registerEventName(String) first!
        time - Timestamp
        iteration - Iteration for the event
        epoch - Epoch for the event
        scalar - Scalar value to write
        Returns:
        Number of bytes written
        Throws:
        IOException
      • encodeStaticHeader

        protected Pair<Integer,​com.google.flatbuffers.FlatBufferBuilder> encodeStaticHeader​(byte type)
        Encode the header as a UIStaticInfoRecord instance for the specific UIEventType
        Parameters:
        type - UIEventType
      • encodeGraphStructure

        protected int encodeGraphStructure​(com.google.flatbuffers.FlatBufferBuilder fbb,
                                           SameDiff sd)