public interface Experiment extends AutoCloseable
Experiment is a unit of measurable research that defines a single run with
some data/parameters/code/results.
Creating an Experiment object in your code will report a new experiment to
your Comet.ml project.
Your Experiment will automatically track and collect many things and will also
allow you to manually report anything.
| Modifier and Type | Method and Description |
|---|---|
void |
addTag(String tag)
Adds a tag to this experiment.
|
void |
end()
Tells Comet that the Experiment is complete and release all associated resources.
|
List<LoggedExperimentAsset> |
getAllAssetList()
Get list of all logged experiment assets.
|
LoggedArtifact |
getArtifact(String name)
Allows looking for logged artifact using provided search parameters.
|
LoggedArtifact |
getArtifact(String name,
String workspace)
Allows looking for logged artifact using provided search parameters.
|
LoggedArtifact |
getArtifact(String name,
String workspace,
String versionOrAlias)
Allows looking for logged artifact using provided search parameters.
|
List<LoggedExperimentAsset> |
getAssetList(String type)
Get list of the logged experiment assets with particular type.
|
String |
getExperimentKey()
Get the experiment key returned by Comet.
|
Optional<String> |
getExperimentLink()
Get the experiment link returned by Comet.
|
String |
getExperimentName()
Get experiment name.
|
GitMetaData |
getGitMetadata()
Get experiment git metadata.
|
Optional<String> |
getGraph()
Get experiment graph data.
|
Optional<String> |
getHtml()
Get experiment html.
|
List<Value> |
getLogOther()
Get experiment log other data.
|
ExperimentMetadata |
getMetadata()
Get experiment metadata.
|
List<Value> |
getMetrics()
Get experiment metrics.
|
Optional<String> |
getOutput()
Get experiment output data.
|
List<Value> |
getParameters()
Get experiment parameters.
|
String |
getProjectName()
Get project name of the experiment.
|
List<String> |
getTags()
Get experiment tags.
|
String |
getWorkspaceName()
Get workspace name of the experiment.
|
void |
logCode(File file)
Allows you to report code for the experiment.
|
void |
logCode(File file,
ExperimentContext context)
Allows you to report code for the experiment.
|
void |
logCode(String code,
String logicalPath)
Allows you to report code for the experiment.
|
void |
logCode(String code,
String logicalPath,
ExperimentContext context)
Allows you to report code for the experiment.
|
void |
logCurve(Curve curve) |
void |
logCurve(Curve curve,
boolean overwrite) |
void |
logCurve(Curve curve,
boolean overwrite,
ExperimentContext context)
Allows to log x/y curve into your Comet experiment.
|
void |
logEndTime(long endTimeMillis)
Logs the start time of the experiment.
|
void |
logGitMetadata(GitMetaData gitMetadata)
Logs Git Metadata for the experiment.
|
void |
logGraph(String graph)
Logs a graph to Comet.
|
void |
logHtml(String html,
boolean override)
Allows you to create html report for the experiment.
|
void |
logLine(String line,
long offset,
boolean stderr,
String context)
Send logs to Comet.
|
void |
logMetric(String metricName,
Object metricValue,
ExperimentContext context)
Logs a metric with Comet.
|
void |
logMetric(String metricName,
Object metricValue,
long step,
long epoch)
Logs a metric with Comet.
|
void |
logOther(String key,
Object value)
Logs a key value pair with Comet.
|
void |
logParameter(String parameterName,
Object paramValue,
ExperimentContext context)
Logs a param with Comet.
|
void |
logParameter(String parameterName,
Object paramValue,
long step)
Logs a param with Comet.
|
void |
logStartTime(long startTimeMillis)
Logs the start time of the experiment.
|
void |
logText(String text) |
void |
logText(String text,
ExperimentContext context) |
void |
logText(String text,
ExperimentContext context,
Map<String,Object> metadata)
Allows to log additional textual data associated with Comet Experiment.
|
void |
setExperimentName(String experimentName)
Sets the experiment name.
|
void |
uploadAsset(File asset,
boolean overwrite,
ExperimentContext context)
Upload an asset to be associated with the experiment, for example the trained weights of a neural net.
|
void |
uploadAsset(File asset,
boolean overwrite,
long step,
long epoch)
Upload an asset to be associated with the experiment, for example the trained weights of a neural net.
|
void |
uploadAsset(File asset,
String logicalPath,
boolean overwrite,
ExperimentContext context)
Upload an asset to be associated with the experiment, for example the trained weights of a neural net.
|
void |
uploadAsset(File asset,
String logicalPath,
boolean overwrite,
long step,
long epoch)
Upload an asset to be associated with the experiment, for example the trained weights of a neural net.
|
closeString getExperimentKey()
Optional<String> getExperimentLink()
String getProjectName()
String getWorkspaceName()
String getExperimentName()
ExperimentMetadata getMetadata()
GitMetaData getGitMetadata()
Optional<String> getOutput()
Optional<String> getGraph()
List<Value> getParameters()
List<Value> getMetrics()
List<Value> getLogOther()
List<LoggedExperimentAsset> getAssetList(String type)
type - the type of assets to be included.List<LoggedExperimentAsset> getAllAssetList()
LoggedArtifact getArtifact(String name, String workspace, String versionOrAlias) throws ArtifactException
name - the short name of the artifact like 'artifact-name'.workspace - the workspace where artifact was saved.versionOrAlias - the artifact version or alias to be returned.LoggedArtifact instance.ArtifactException - if failed to get comet artifact.LoggedArtifact getArtifact(String name, String workspace) throws ArtifactException
name - the short name of the artifact like 'artifact-name' or
the name of artifact with version or alias like 'artifact-name:versionOrAlias'.workspace - the workspace where artifact was saved.LoggedArtifact instance.ArtifactException - if failed to get comet artifact.LoggedArtifact getArtifact(String name) throws ArtifactException
name - the name of the artifact. This could either be a fully
qualified artifact name like 'workspace/artifact-name:versionOrAlias'
or any short forms like 'artifact-name', 'artifact-name:versionOrAlias'.LoggedArtifact instance.ArtifactException - if failed to get comet artifact.void setExperimentName(String experimentName)
experimentName - The new name for the experimentvoid logLine(String line, long offset, boolean stderr, String context)
line - Text to be loggedoffset - Offset describes the place for current text to be insertedstderr - the flag to indicate if this is StdErr message.context - the context to be associated with the parameter.void logMetric(String metricName, Object metricValue, ExperimentContext context)
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 them.context - the context to be associated with the metric.void logMetric(String metricName, Object metricValue, long step, long epoch)
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 experimentepoch - The current epoch for this metric, this will set the given epoch for this experiment.void logParameter(String parameterName, Object paramValue, ExperimentContext context)
parameterName - The name of the param being loggedparamValue - The value for the param being loggedcontext - the context to be associated with the parameter.void logParameter(String parameterName, Object paramValue, long step)
parameterName - The name of the param being loggedparamValue - The value for the param being loggedstep - The current step for this metric, this will set the given step for this experiment.void logHtml(String html, boolean override)
html - A block of html to be sent to Cometoverride - Whether previous html sent should be deleted. If true the old html will be deleted.
If false, it will have the new html appended onto the end.void logOther(String key, Object value)
key - The key for the data to be storedvalue - The value for said keyvoid addTag(String tag)
tag - The tag to be addedvoid logGraph(String graph)
graph - The graph to be loggedvoid logStartTime(long startTimeMillis)
startTimeMillis - When you want to say that the experiment startedvoid logEndTime(long endTimeMillis)
endTimeMillis - When you want to say that the experiment endedvoid logCode(String code, String logicalPath, ExperimentContext context)
code - Code to be sent to CometlogicalPath - Name of source file to be displayed on UI 'code' tabcontext - the context to be associated with the asset.void logCode(String code, String logicalPath)
code - Code to be sent to CometlogicalPath - Name of source file to be displayed on UI 'code' tabvoid logCode(File file, ExperimentContext context)
file - Asset with source code to be sentcontext - the context to be associated with the asset.void logCode(File file)
file - Asset with source code to be sentvoid logText(String text, ExperimentContext context, Map<String,Object> metadata)
text - the text data to be logged.context - the current experiment context to be associated.metadata - the additional metadata for the text.void logText(String text, ExperimentContext context)
void logText(String text)
void logCurve(Curve curve, boolean overwrite, ExperimentContext context)
curve - the Curve object holding the data points.overwrite - allows to override the previously logged curve with the same name.context - the experiment context to be associated with data record (step, epoch, context ID).void logCurve(Curve curve, boolean overwrite)
void logCurve(Curve curve)
void uploadAsset(File asset, String logicalPath, boolean overwrite, ExperimentContext context)
asset - The asset to be storedlogicalPath - 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 Cometcontext - the context to be associated with the asset.void uploadAsset(File asset, String logicalPath, boolean overwrite, long step, long epoch)
asset - The asset to be storedlogicalPath - 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 the assetepoch - the epoch to be associated with the assetvoid uploadAsset(File asset, boolean overwrite, ExperimentContext context)
asset - The file asset to be stored. The name of the file will be used as assets identifier on Comet.overwrite - Whether to overwrite files of the same name in Cometcontext - the context to be associated with the asset.void uploadAsset(File asset, boolean overwrite, long step, long epoch)
asset - The file asset to be stored. The name of the file will be used as assets identifier on Comet.overwrite - Whether to overwrite files of the same name in Cometstep - the step to be associated with the assetepoch - the epoch to be associated with the assetvoid logGitMetadata(GitMetaData gitMetadata)
gitMetadata - The Git Metadata for the experimentvoid end()
Copyright © 2022. All rights reserved.