Web-based user interface module for DeepLearning4J that provides visualization and monitoring capabilities for deep learning model training and evaluation
npx @tessl/cli install tessl/maven-org-deeplearning4j--deeplearning4j-ui_2-11@0.9.0DeepLearning4J UI is a web-based user interface module that provides real-time visualization and monitoring capabilities for deep learning model training and evaluation. It offers interactive dashboards for tracking training progress, loss curves, network architecture visualization, and performance metrics through a web browser interface.
pom.xml:<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-ui_2.11</artifactId>
<version>0.9.1</version>
</dependency>import org.deeplearning4j.ui.api.UIServer;
import org.deeplearning4j.ui.stats.StatsListener;
import org.deeplearning4j.ui.storage.InMemoryStatsStorage;
// Core API interfaces
import org.deeplearning4j.api.storage.Persistable;
import org.deeplearning4j.api.storage.StatsStorage;
import org.deeplearning4j.api.storage.StatsStorageRouter;
import org.deeplearning4j.api.storage.StorageMetaData;
// Statistics configuration
import org.deeplearning4j.ui.stats.api.StatsUpdateConfiguration;
import org.deeplearning4j.ui.stats.api.StatsInitializationConfiguration;
import org.deeplearning4j.ui.stats.api.StatsType;
import org.deeplearning4j.ui.stats.api.SummaryType;import org.deeplearning4j.ui.api.UIServer;
import org.deeplearning4j.ui.stats.StatsListener;
import org.deeplearning4j.ui.storage.InMemoryStatsStorage;
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork;
// Start the UI server
UIServer uiServer = UIServer.getInstance();
// Create storage for training statistics
InMemoryStatsStorage statsStorage = new InMemoryStatsStorage();
// Attach the storage to the UI server
uiServer.attach(statsStorage);
// Create a listener to collect training statistics
StatsListener statsListener = new StatsListener(statsStorage);
// Add the listener to your neural network
MultiLayerNetwork network = new MultiLayerNetwork(conf);
network.init();
network.setListeners(statsListener);
// Train your network - statistics will be automatically collected and displayed
network.fit(trainingData);
// Access the UI at http://localhost:9000The DeepLearning4J UI system is built around several key components:
Central server management for the web-based monitoring interface.
public abstract class UIServer {
public static synchronized UIServer getInstance();
public abstract String getAddress();
public abstract int getPort();
public abstract void attach(StatsStorage statsStorage);
public abstract void detach(StatsStorage statsStorage);
public abstract boolean isAttached(StatsStorage statsStorage);
public abstract List<StatsStorage> getStatsStorageInstances();
public abstract void enableRemoteListener();
}Comprehensive training statistics collection and monitoring system.
public class StatsListener extends BaseStatsListener {
public StatsListener(StatsStorageRouter router);
public StatsListener(StatsStorageRouter router, int listenerFrequency);
public StatsListener clone();
}Various storage backends for collected training statistics.
public class InMemoryStatsStorage extends BaseCollectionStatsStorage {
public InMemoryStatsStorage();
public void putStaticInfo(Persistable staticInfo);
public void putUpdate(Persistable update);
}UI component system for building custom visualizations and reports.
public abstract class Component {
// Base class for all UI components
}
public abstract class Chart extends Component {
// Base class for chart components
}Remote iteration listeners for distributed training scenarios.
public class WebReporter {
public static WebReporter getInstance();
public void queueReport(WebTarget target, Entity entity);
}// Storage interface for statistics data
public interface StatsStorage extends StatsStorageRouter {
List<String> listSessionIDs();
boolean sessionExists(String sessionID);
Persistable getStaticInfo(String sessionID, String typeID, String workerID);
List<Persistable> getAllStaticInfos(String sessionID, String typeID);
List<Persistable> getLatestUpdateAllWorkers(String sessionID, String typeID);
}
// Configuration for statistics collection
public interface StatsUpdateConfiguration {
long getReportingFrequency();
boolean collectParameterStats();
boolean collectActivationStats();
boolean collectGradientStats();
}
// Base interface for persistable data
public interface Persistable extends Serializable {
// Identification methods
String getSessionID();
String getTypeID();
String getWorkerID();
long getTimeStamp();
// Serialization methods
int encodingLengthBytes();
byte[] encode();
void encode(ByteBuffer buffer);
void encode(OutputStream outputStream) throws IOException;
void decode(byte[] decode);
void decode(ByteBuffer buffer);
void decode(InputStream inputStream) throws IOException;
}
// Enumeration of statistics types
public enum StatsType {
Parameters, Gradients, Updates, Activations
}
// Enumeration of summary types
public enum SummaryType {
Mean, Stdev, MeanMagnitudes
}