Package org.nd4j.graph.ui
Class LogFileWriter
- java.lang.Object
-
- org.nd4j.graph.ui.LogFileWriter
-
public class LogFileWriter extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLogFileWriter.EventSubtypestatic classLogFileWriter.StaticInfo
-
Constructor Summary
Constructors Constructor Description LogFileWriter(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intencodeGraphStructure(com.google.flatbuffers.FlatBufferBuilder fbb, SameDiff sd)protected Pair<Integer,com.google.flatbuffers.FlatBufferBuilder>encodeStaticHeader(byte type)Encode the header as a UIStaticInfoRecord instance for the specificUIEventTypeList<Pair<UIEvent,com.google.flatbuffers.Table>>readEvents()Read all of the events.List<Pair<UIEvent,com.google.flatbuffers.Table>>readEvents(long startOffset)Read all of the events starting at a specific file offsetLogFileWriter.StaticInforeadStatic()Read all static information at the start of the filebooleanregisteredEventName(String name)longregisterEventName(String name)Register the event name - "accuracy", "loss", etc for later use in recording events.longregisterEventNameQuiet(String name)longwriteFinishStaticMarker()Write marker for final static datalongwriteGraphStructure(SameDiff sd)Write the graph structurelongwriteHistogramEventCustomBins(String name, LogFileWriter.EventSubtype subtype, long time, int iteration, int epoch, INDArray bins, INDArray y)longwriteHistogramEventDiscrete(@NonNull String name, LogFileWriter.EventSubtype subtype, long time, int iteration, int epoch, List<String> binLabels, @NonNull INDArray y)longwriteHistogramEventEqualSpacing(String name, LogFileWriter.EventSubtype subtype, long time, int iteration, int epoch, double min, double max, INDArray y)longwriteScalarEvent(String name, LogFileWriter.EventSubtype subtype, long time, int iteration, int epoch, Number scalar)Write a single scalar event to the file
-
-
-
Constructor Detail
-
LogFileWriter
public LogFileWriter(File file) throws IOException
- Throws:
IOException
-
-
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 IOExceptionWrite marker for final static data- Returns:
- Throws:
IOException
-
readStatic
public LogFileWriter.StaticInfo readStatic() throws IOException
Read all static information at the start of the file- Returns:
- Throws:
IOException
-
readEvents
public List<Pair<UIEvent,com.google.flatbuffers.Table>> readEvents() throws IOException
Read all of the events.- Returns:
- All of the UI events
- 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 byregisterEventName(String)first!time- Timestampiteration- Iteration for the eventepoch- Epoch for the eventscalar- Scalar value to write- Returns:
- Number of bytes written
- Throws:
IOException
-
writeHistogramEventDiscrete
public long writeHistogramEventDiscrete(@NonNull @NonNull String name, LogFileWriter.EventSubtype subtype, long time, int iteration, int epoch, List<String> binLabels, @NonNull @NonNull INDArray y) throws IOException- Throws:
IOException
-
writeHistogramEventEqualSpacing
public long writeHistogramEventEqualSpacing(String name, LogFileWriter.EventSubtype subtype, long time, int iteration, int epoch, double min, double max, INDArray y) throws IOException
- Throws:
IOException
-
writeHistogramEventCustomBins
public long writeHistogramEventCustomBins(String name, LogFileWriter.EventSubtype subtype, long time, int iteration, int epoch, INDArray bins, INDArray y) throws IOException
- Throws:
IOException
-
encodeStaticHeader
protected Pair<Integer,com.google.flatbuffers.FlatBufferBuilder> encodeStaticHeader(byte type)
Encode the header as a UIStaticInfoRecord instance for the specificUIEventType- Parameters:
type- UIEventType
-
encodeGraphStructure
protected int encodeGraphStructure(com.google.flatbuffers.FlatBufferBuilder fbb, SameDiff sd)
-
-