Log assets¶
Comet's assets allow you to log any type of data to the Comet platform, which is useful (and should be used only) for data types that do not have a dedicated logging method (e.g., you should log metrics with log_metrics()
, artifacts with log_artifacts()
, etc.).
Comet allows you to analyze experiment assets by loading them into Python Panels with custom code.
The following methods can be used to log assets:
The following panel can be used to visualize assets:
In addition all the assets logged to an Experiment can be view in the Single Experiment page tab:
- Assets & Artifacts Tab:
others
folder.
For example, you could...
Log research papers, technical reports, blog posts, project proposals, or other reference documentation, that you have used as inspiration or baseline for the model experimentation.
Log a single asset¶
The example below logs a single .txt
file to Comet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Additionally, you could use the overwrite
argument to overwrite any existing asset with the same name or add a metadata
argument to log extra information (such as tags) in a JSON format.
Log an asset folder¶
The example below logs a folder named example, with all its content, to Comet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
With the log_file_name
argument set to True, Comet logs the file path with each file. Additionally, you could decide to set the recursive
argument as True to recursively navigate the folder but this is not necessary for this example.
Display an asset with a Python Panel¶
The example below showcases how to code a Python Panel to display the content of any logged text-based asset for any available experiment.
Please refer to the Python Panel documentation for information on how to create the panel end-to-end.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
The Python panel created with the example code above enables the user to select the desired experiment and asset from dropdown. Then, the panel automatically displays the content for the selected asset (if supported). We could call this panel "Display text asset".
The screenshot below showcases this functionality for the test.txt
file created in the Log a single asset section above.