use of org.deeplearning4j.api.storage.StatsStorageEvent in project deeplearning4j by deeplearning4j.
the class InMemoryStatsStorage method putStorageMetaData.
@Override
public void putStorageMetaData(StorageMetaData storageMetaData) {
List<StatsStorageEvent> sses = checkStorageEvents(storageMetaData);
SessionTypeId id = new SessionTypeId(storageMetaData.getSessionID(), storageMetaData.getTypeID());
this.storageMetaData.put(id, storageMetaData);
StatsStorageEvent sse = null;
if (listeners.size() > 0)
sse = new StatsStorageEvent(this, StatsStorageListener.EventType.PostMetaData, storageMetaData.getSessionID(), storageMetaData.getTypeID(), storageMetaData.getWorkerID(), storageMetaData.getTimeStamp());
for (StatsStorageListener l : listeners) {
l.notify(sse);
}
notifyListeners(sses);
}
use of org.deeplearning4j.api.storage.StatsStorageEvent in project deeplearning4j by deeplearning4j.
the class InMemoryStatsStorage method putStaticInfo.
@Override
public void putStaticInfo(Persistable staticInfo) {
List<StatsStorageEvent> sses = checkStorageEvents(staticInfo);
if (!sessionIDs.contains(staticInfo.getSessionID())) {
sessionIDs.add(staticInfo.getSessionID());
}
SessionTypeWorkerId id = new SessionTypeWorkerId(staticInfo.getSessionID(), staticInfo.getTypeID(), staticInfo.getWorkerID());
this.staticInfo.put(id, staticInfo);
StatsStorageEvent sse = null;
if (listeners.size() > 0)
sse = new StatsStorageEvent(this, StatsStorageListener.EventType.PostStaticInfo, staticInfo.getSessionID(), staticInfo.getTypeID(), staticInfo.getWorkerID(), staticInfo.getTimeStamp());
for (StatsStorageListener l : listeners) {
l.notify(sse);
}
notifyListeners(sses);
}
use of org.deeplearning4j.api.storage.StatsStorageEvent in project deeplearning4j by deeplearning4j.
the class ConvolutionalListenerModule method reportStorageEvents.
@Override
public synchronized void reportStorageEvents(Collection<StatsStorageEvent> events) {
for (StatsStorageEvent sse : events) {
if (TYPE_ID.equals(sse.getTypeID()) && sse.getEventType() == StatsStorageListener.EventType.PostStaticInfo) {
if (sse.getTimestamp() > lastTimeStamp) {
lastStorage = sse.getStatsStorage();
lastSessionID = sse.getSessionID();
lastWorkerID = sse.getWorkerID();
lastTimeStamp = sse.getTimestamp();
}
}
}
}
use of org.deeplearning4j.api.storage.StatsStorageEvent in project deeplearning4j by deeplearning4j.
the class InMemoryStatsStorage method putUpdate.
@Override
public void putUpdate(Persistable update) {
List<StatsStorageEvent> sses = checkStorageEvents(update);
Map<Long, Persistable> updateMap = getUpdateMap(update.getSessionID(), update.getTypeID(), update.getWorkerID(), true);
updateMap.put(update.getTimeStamp(), update);
StatsStorageEvent sse = null;
if (listeners.size() > 0)
sse = new StatsStorageEvent(this, StatsStorageListener.EventType.PostUpdate, update.getSessionID(), update.getTypeID(), update.getWorkerID(), update.getTimeStamp());
for (StatsStorageListener l : listeners) {
l.notify(sse);
}
notifyListeners(sses);
}
Aggregations