public interface OnlineExperiment extends Experiment
OnlineExperiment should be used to asynchronously update data of your Comet.ml experiment.
This experiment type allows you to automatically intercept StdOut and StdErr streams and send
them to the Comet.ml. Use the setInterceptStdout() to start automatic interception of StdOut and
the stopInterceptStdout() to stop.
Also, it is possible to use setStep(long), setEpoch(long),
and setContext(String) which will bbe automatically associated with related logged data records.
| Modifier and Type | Method and Description |
|---|---|
String |
getContext()
Gets the current context identifier as recorded in the
OnlineExperiment object locally. |
long |
getEpoch()
Gets the current epoch as recorded by the Experiment object locally.
|
long |
getStep()
Gets the current step as recorded by the Experiment object locally.
|
void |
logAssetFolder(File folder,
boolean logFilePath) |
void |
logAssetFolder(File folder,
boolean logFilePath,
boolean recursive) |
void |
logAssetFolder(File folder,
boolean logFilePath,
boolean recursive,
ExperimentContext context)
Logs all the files located in the given folder as assets.
|
void |
logLine(String line,
long offset,
boolean stderr)
Send output logs to Comet.
|
void |
logMetric(String metricName,
Object metricValue) |
void |
logMetric(String metricName,
Object metricValue,
long step)
Logs a metric with Comet.
|
void |
logParameter(String parameterName,
Object paramValue)
Logs a param with Comet under the current experiment step.
|
void |
logRemoteAsset(URI uri,
boolean overwrite) |
void |
logRemoteAsset(URI uri,
String fileName,
boolean overwrite) |
void |
logRemoteAsset(URI uri,
String fileName,
boolean overwrite,
Map<String,Object> metadata) |
void |
logRemoteAsset(URI uri,
String fileName,
boolean overwrite,
Map<String,Object> metadata,
ExperimentContext context)
Logs a Remote Asset identified by a
URI. |
void |
nextEpoch()
Increments the epoch that the experiment is on.
|
void |
nextStep()
Increments the step that the experiment is on.
|
void |
setContext(String context)
Sets the context identifier for any logs and uploaded files.
|
void |
setEpoch(long epoch)
Sets the current epoch for the experiment.
|
void |
setInterceptStdout()
Turn on intercept of stdout and stderr and the logging of both in Comet.
|
void |
setStep(long step)
Sets the current step for the experiment.
|
void |
stopInterceptStdout()
Turn off intercept of stdout and stderr and turns off their logging in Comet.
|
void |
uploadAsset(File asset,
boolean overwrite) |
void |
uploadAsset(File asset,
String fileName,
boolean overwrite) |
void |
uploadAsset(File asset,
String fileName,
boolean overwrite,
long step)
Upload an asset under the current experiment step to be associated with the experiment,
for example the trained weights of a neural net.
|
addTag, end, getAssetList, getExperimentKey, getExperimentLink, getExperimentName, getGitMetadata, getGraph, getHtml, getLogOther, getMetadata, getMetrics, getOutput, getParameters, getProjectName, getTags, getWorkspaceName, logCode, logCode, logCode, logCode, logEndTime, logGitMetadata, logGraph, logHtml, logLine, logMetric, logMetric, logOther, logParameter, logParameter, logStartTime, setExperimentName, uploadAsset, uploadAsset, uploadAsset, uploadAssetclosevoid setInterceptStdout()
throws IOException
IOException - if an I/O exception occurs.void stopInterceptStdout()
throws IOException
IOException - if an I/O exception occurs.void setStep(long step)
step - the current step of the experiment.void nextStep()
long getStep()
void setEpoch(long epoch)
epoch - the current epoch for the experiment.void nextEpoch()
long getEpoch()
void setContext(String context)
context - the context identifier to be associated with any log records, files, and assets.String getContext()
OnlineExperiment object locally.void logMetric(String metricName, Object metricValue, long step)
metricName - The name for the metric to be loggedmetricValue - The new value for the metric. If the values for a metric are plottable we will plot themstep - The current step for this metric, this will set the given step for this experimentvoid logParameter(String parameterName, Object paramValue)
parameterName - The name of the param being loggedparamValue - The value for the param being loggedvoid logLine(String line, long offset, boolean stderr)
line - Text to be loggedoffset - Offset describes the place for current text to be insertedstderr - the flag to indicate if this is StdErr message.void uploadAsset(File asset, String fileName, boolean overwrite, long step)
asset - The asset to be storedfileName - The file name under which the asset should be stored in Comet. E.g. "someFile.txt"overwrite - Whether to overwrite files of the same name in Cometstep - The step to be associated with assetvoid uploadAsset(File asset, boolean overwrite)
void logAssetFolder(File folder, boolean logFilePath, boolean recursive, ExperimentContext context)
folder - the folder you want to log.logFilePath - if true, log the file path with each file.recursive - if true, recurse the folder.context - the experiment context to be associated with the logged assets.void logAssetFolder(File folder, boolean logFilePath, boolean recursive)
void logAssetFolder(File folder, boolean logFilePath)
void logRemoteAsset(URI uri, String fileName, boolean overwrite, Map<String,Object> metadata, ExperimentContext context)
URI. A Remote Asset is an asset but its content is not uploaded
and stored on Comet. Rather a link for its location is stored, so you can identify and distinguish
between two experiment using different version of a dataset stored somewhere else.uri - the URI pointing to the remote asset location. There is no imposed format,
and it could be a private link.fileName - the optional "name" of the remote asset, could be a dataset name, a model file name.overwrite - if true will overwrite all existing assets with the same name.metadata - Some additional data to attach to the remote asset.
The dictionary values must be JSON compatible.context - the experiment context to be associated with the logged assets.void logRemoteAsset(URI uri, String fileName, boolean overwrite, Map<String,Object> metadata)
void logRemoteAsset(URI uri, boolean overwrite)
Copyright © 2021. All rights reserved.