experiments
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| experiments [2025/05/30 13:04] – [Conclusion] eagleeyenebula | experiments [2025/06/06 12:53] (current) – [Experiment Manager] eagleeyenebula | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| **[[https:// | **[[https:// | ||
| The AI Experiment Manager system is responsible for managing and logging configurations, | The AI Experiment Manager system is responsible for managing and logging configurations, | ||
| + | |||
| + | {{youtube> | ||
| + | |||
| + | ------------------------------------------------------------- | ||
| Built with flexibility and performance in mind, the Experiment Manager supports versioning of configurations, | Built with flexibility and performance in mind, the Experiment Manager supports versioning of configurations, | ||
| Line 30: | Line 34: | ||
| ===== System Design ===== | ===== System Design ===== | ||
| - | The Experiment Manager consists of a single lightweight class `ExperimentManager`. It features a static method, `log_experiment`, | + | The Experiment Manager consists of a single lightweight class **ExperimentManager**. It features a static method, `log_experiment`, |
| - | | + | 1. Takes in **experiment configurations** and **results** in dictionary format. |
| - | 2. Serializes the data into structured JSON. | + | |
| - | 3. Appends the JSON data to the specified file, defaulting to `experiment_logs.json`. | + | |
| - | Code snippet for the `ExperimentManager` class: | + | 2. Serializes the data into structured **JSON**. |
| + | |||
| + | 3. Appends the **JSON** data to the specified file, defaulting to **experiment_logs.jso**. | ||
| + | |||
| + | Code snippet for the **ExperimentManager** class: | ||
| < | < | ||
| - | ```python | + | python |
| import logging | import logging | ||
| import json | import json | ||
| Line 68: | Line 74: | ||
| except Exception as e: | except Exception as e: | ||
| logging.error(f" | logging.error(f" | ||
| - | ``` | ||
| </ | </ | ||
| Line 78: | Line 83: | ||
| < | < | ||
| - | ```python | + | python |
| from experiment_manager import ExperimentManager | from experiment_manager import ExperimentManager | ||
| Line 99: | Line 104: | ||
| ExperimentManager.log_experiment(config, | ExperimentManager.log_experiment(config, | ||
| print(" | print(" | ||
| - | ``` | + | |
| </ | </ | ||
| Line 105: | Line 110: | ||
| < | < | ||
| - | ```json | + | json |
| { | { | ||
| " | " | ||
| Line 120: | Line 125: | ||
| } | } | ||
| } | } | ||
| - | ``` | + | |
| </ | </ | ||
| Line 128: | Line 133: | ||
| < | < | ||
| - | ```python | + | python |
| config = { | config = { | ||
| " | " | ||
| Line 142: | Line 147: | ||
| file_path = " | file_path = " | ||
| ExperimentManager.log_experiment(config, | ExperimentManager.log_experiment(config, | ||
| - | ``` | + | |
| </ | </ | ||
| Line 150: | Line 155: | ||
| < | < | ||
| - | ```python | + | python |
| import datetime | import datetime | ||
| import uuid | import uuid | ||
| Line 169: | Line 174: | ||
| ExperimentManager.log_experiment(config, | ExperimentManager.log_experiment(config, | ||
| - | ``` | + | |
| </ | </ | ||
| Line 175: | Line 180: | ||
| < | < | ||
| - | ```json | + | json |
| { | { | ||
| " | " | ||
| Line 189: | Line 194: | ||
| } | } | ||
| } | } | ||
| - | ``` | + | |
| </ | </ | ||
| Line 197: | Line 202: | ||
| < | < | ||
| - | ```python | + | python |
| batch = [ | batch = [ | ||
| { | { | ||
| Line 211: | Line 216: | ||
| for experiment in batch: | for experiment in batch: | ||
| ExperimentManager.log_experiment(experiment[" | ExperimentManager.log_experiment(experiment[" | ||
| - | ``` | + | |
| </ | </ | ||
| Line 219: | Line 224: | ||
| < | < | ||
| - | ```python | + | python |
| try: | try: | ||
| ExperimentManager.log_experiment({" | ExperimentManager.log_experiment({" | ||
| except Exception as e: | except Exception as e: | ||
| print(f" | print(f" | ||
| - | ``` | + | |
| </ | </ | ||
| Line 232: | Line 237: | ||
| 1. **Cloud Storage**: | 1. **Cloud Storage**: | ||
| - | | + | * Modify |
| 2. **Database Integration**: | 2. **Database Integration**: | ||
| - | | + | * Replace file storage with **SQL/NoSQL** databases for scalable operations. |
| 3. **Real-Time Monitoring**: | 3. **Real-Time Monitoring**: | ||
| - | | + | * Stream results into a dashboard for live experiment tracking. |
| 4. **Summarized Logging**: | 4. **Summarized Logging**: | ||
| - | | + | * Automatically summarize metrics (e.g., show only the top 5 accuracies). |
| ===== Best Practices ===== | ===== Best Practices ===== | ||
experiments.1748610290.txt.gz · Last modified: 2025/05/30 13:04 by eagleeyenebula
