public final class ApiExperimentImpl extends Object implements ApiExperiment
Experiment that allows to read/update existing experiment synchronously.| Modifier and Type | Class and Description |
|---|---|
static class |
ApiExperimentImpl.ApiExperimentBuilderImpl
The builder to create properly configured ApiExperiment instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTag(@NonNull String tag)
Synchronous version that waits for result or exception.
|
static ApiExperimentImpl.ApiExperimentBuilderImpl |
builder()
Returns builder to create
Experiment instance. |
static ApiExperimentImpl.ApiExperimentBuilderImpl |
builder(@NonNull String experimentKey)
Returns builder to create
Experiment instance. |
void |
close() |
void |
end()
Tells Comet that the Experiment is complete and release all associated resources.
|
List<ExperimentAssetLink> |
getAssetList(@NonNull AssetType type)
Get experiment asset list.
|
String |
getExperimentKey()
Get the experiment key returned by Comet.
|
Optional<String> |
getExperimentLink()
Get the experiment link returned by Comet.
|
String |
getExperimentName()
Get experiment name.
|
GitMetadataRest |
getGitMetadata()
Get experiment git metadata.
|
Optional<String> |
getGraph()
Get experiment graph data.
|
Optional<String> |
getHtml()
Get experiment html.
|
protected abstract org.slf4j.Logger |
getLogger()
Returns logger instance associated with particular experiment.
|
List<ValueMinMaxDto> |
getLogOther()
Get experiment log other data.
|
ExperimentMetadataRest |
getMetadata()
Get experiment metadata.
|
List<ValueMinMaxDto> |
getMetrics()
Get experiment metrics.
|
Optional<String> |
getOutput()
Get experiment output data.
|
List<ValueMinMaxDto> |
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(@NonNull File file,
@NonNull ExperimentContext context)
Allows you to report code for the experiment.
|
void |
logCode(String code,
String fileName)
Allows you to report code for the experiment.
|
void |
logCode(@NonNull String code,
@NonNull String fileName,
@NonNull ExperimentContext context)
Allows you to report code for the experiment.
|
void |
logEndTime(long endTimeMillis)
Synchronous version that waits for result or exception.
|
void |
logGitMetadata(GitMetadata gitMetadata)
Synchronous version that waits for result or exception.
|
void |
logGraph(@NonNull String graph)
Synchronous version that waits for result or exception.
|
void |
logHtml(@NonNull String html,
boolean override)
Synchronous version that waits for result or exception.
|
void |
logLine(String line,
long offset,
boolean stderr,
String context)
Synchronous version that waits for result or exception.
|
void |
logMetric(@NonNull String metricName,
@NonNull Object metricValue,
@NonNull ExperimentContext context)
Synchronous version that waits for result or exception.
|
void |
logMetric(String metricName,
Object metricValue,
long step,
long epoch)
Logs a metric with Comet.
|
void |
logOther(@NonNull String key,
@NonNull Object value)
Synchronous version that waits for result or exception.
|
void |
logParameter(String parameterName,
Object paramValue,
ExperimentContext context)
Synchronous version that waits for result or exception.
|
void |
logParameter(String parameterName,
Object paramValue,
long step)
Logs a param with Comet.
|
void |
logStartTime(long startTimeMillis)
Synchronous version that waits for result or exception.
|
void |
setExperimentName(@NonNull String experimentName)
Sets the experiment name.
|
void |
uploadAsset(@NonNull File asset,
boolean overwrite,
@NonNull ExperimentContext context)
Upload an asset to be associated with the experiment, for example the trained weights of a neural net.
|
void |
uploadAsset(@NonNull 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(@NonNull File file,
@NonNull String fileName,
boolean overwrite,
@NonNull ExperimentContext context)
Upload an asset to be associated with the experiment, for example the trained weights of a neural net.
|
void |
uploadAsset(@NonNull File asset,
String fileName,
boolean overwrite,
long step,
long epoch)
Upload an asset to be associated with the experiment, for example the trained weights of a neural net.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTag, end, getAssetList, getExperimentKey, getGitMetadata, getGraph, getHtml, getLogOther, getMetadata, getMetrics, getOutput, getParameters, getTags, logCode, logCode, logCode, logCode, logEndTime, logGitMetadata, logGraph, logHtml, logLine, logMetric, logMetric, logOther, logParameter, logParameter, logStartTime, setExperimentName, uploadAsset, uploadAsset, uploadAsset, uploadAssetpublic String getWorkspaceName()
ExperimentgetWorkspaceName in interface Experimentpublic String getProjectName()
ExperimentgetProjectName in interface Experimentpublic String getExperimentName()
ExperimentgetExperimentName in interface Experimentpublic Optional<String> getExperimentLink()
ExperimentgetExperimentLink in interface Experimentpublic void close()
close in interface AutoCloseablepublic static ApiExperimentImpl.ApiExperimentBuilderImpl builder(@NonNull @NonNull String experimentKey)
Experiment instance.experimentKey - the unique identifier of the existing experiment.ApiExperimentBuilder instance.public static ApiExperimentImpl.ApiExperimentBuilderImpl builder()
Experiment instance.ApiExperimentBuilder instance.protected abstract org.slf4j.Logger getLogger()
public String getExperimentKey()
ExperimentgetExperimentKey in interface Experimentpublic void setExperimentName(@NonNull
@NonNull String experimentName)
ExperimentsetExperimentName in interface ExperimentexperimentName - The new name for the experimentpublic void logMetric(@NonNull
@NonNull String metricName,
@NonNull
@NonNull Object metricValue,
@NonNull
@NonNull ExperimentContext context)
logMetric in interface ExperimentmetricName - 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 themcontext - the context to be associated with the parameter.CometApiException - if received response with failure code.public void logMetric(String metricName, Object metricValue, long step, long epoch)
ExperimentlogMetric in interface ExperimentmetricName - 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.public void logParameter(String parameterName, Object paramValue, ExperimentContext context)
logParameter in interface ExperimentparameterName - The name of the param being loggedparamValue - The value for the param being loggedcontext - the context to be associated with the parameter.public void logParameter(String parameterName, Object paramValue, long step)
ExperimentlogParameter in interface ExperimentparameterName - 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.public void logLine(String line, long offset, boolean stderr, String context)
logLine in interface Experimentline - 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.public void logHtml(@NonNull
@NonNull String html,
boolean override)
logHtml in interface Experimenthtml - A block of html to be sent to Cometoverride - Whether previous html sent should be deleted.
If true the old html will be deleted.public void logOther(@NonNull
@NonNull String key,
@NonNull
@NonNull Object value)
logOther in interface Experimentkey - The key for the data to be storedvalue - The value for said keypublic void addTag(@NonNull
@NonNull String tag)
addTag in interface Experimenttag - The tag to be addedpublic void logGraph(@NonNull
@NonNull String graph)
logGraph in interface Experimentgraph - The graph to be logged.public void logStartTime(long startTimeMillis)
logStartTime in interface ExperimentstartTimeMillis - When you want to say that the experiment startedpublic void logEndTime(long endTimeMillis)
logEndTime in interface ExperimentendTimeMillis - When you want to say that the experiment endedpublic void logGitMetadata(GitMetadata gitMetadata)
logGitMetadata in interface ExperimentgitMetadata - The Git Metadata for the experiment.public void logCode(@NonNull
@NonNull String code,
@NonNull
@NonNull String fileName,
@NonNull
@NonNull ExperimentContext context)
ExperimentlogCode in interface Experimentcode - Code to be sent to CometfileName - Name of source file to be displayed on UI 'code' tabcontext - the context to be associated with the asset.public void logCode(String code, String fileName)
ExperimentlogCode in interface Experimentcode - Code to be sent to CometfileName - Name of source file to be displayed on UI 'code' tabpublic void logCode(@NonNull
@NonNull File file,
@NonNull
@NonNull ExperimentContext context)
ExperimentlogCode in interface Experimentfile - Asset with source code to be sentcontext - the context to be associated with the asset.public void logCode(File file)
ExperimentlogCode in interface Experimentfile - Asset with source code to be sentpublic void uploadAsset(@NonNull
@NonNull File file,
@NonNull
@NonNull String fileName,
boolean overwrite,
@NonNull
@NonNull ExperimentContext context)
ExperimentuploadAsset in interface Experimentfile - 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 Cometcontext - the context to be associated with the asset.public void uploadAsset(@NonNull
@NonNull File asset,
String fileName,
boolean overwrite,
long step,
long epoch)
ExperimentuploadAsset in interface Experimentasset - 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 the assetepoch - the epoch to be associated with the assetpublic void uploadAsset(@NonNull
@NonNull File asset,
boolean overwrite,
@NonNull
@NonNull ExperimentContext context)
ExperimentuploadAsset in interface Experimentasset - 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.public void uploadAsset(@NonNull
@NonNull File asset,
boolean overwrite,
long step,
long epoch)
ExperimentuploadAsset in interface Experimentasset - 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 assetpublic ExperimentMetadataRest getMetadata()
ExperimentgetMetadata in interface Experimentpublic GitMetadataRest getGitMetadata()
ExperimentgetGitMetadata in interface Experimentpublic Optional<String> getHtml()
ExperimentgetHtml in interface Experimentpublic Optional<String> getOutput()
ExperimentgetOutput in interface Experimentpublic Optional<String> getGraph()
ExperimentgetGraph in interface Experimentpublic List<ValueMinMaxDto> getParameters()
ExperimentgetParameters in interface Experimentpublic List<ValueMinMaxDto> getMetrics()
ExperimentgetMetrics in interface Experimentpublic List<ValueMinMaxDto> getLogOther()
ExperimentgetLogOther in interface Experimentpublic List<String> getTags()
ExperimentgetTags in interface Experimentpublic List<ExperimentAssetLink> getAssetList(@NonNull @NonNull AssetType type)
ExperimentgetAssetList in interface Experimenttype - the type of assets to be included.public void end()
Experimentend in interface ExperimentCopyright © 2021. All rights reserved.