|
71 | 71 | }, |
72 | 72 | { |
73 | 73 | "cell_type": "code", |
74 | | - "execution_count": 1, |
| 74 | + "execution_count": null, |
75 | 75 | "id": "6605b9f5", |
76 | 76 | "metadata": {}, |
77 | 77 | "outputs": [], |
|
82 | 82 | "# These tutorials use small synthetic datasets and short training runs, which\n", |
83 | 83 | "# surfaces a few non-actionable framework messages. Quieten them so the output\n", |
84 | 84 | "# stays focused on the tutorial; none of them affect correctness.\n", |
85 | | - "warnings.filterwarnings(\"ignore\", message=\".*n_quantiles.*\")\n", |
86 | | - "warnings.filterwarnings(\"ignore\", message=\".*does not have many workers.*\")\n", |
87 | | - "warnings.filterwarnings(\"ignore\", message=\".*have no logger configured.*\")\n", |
88 | | - "warnings.filterwarnings(\"ignore\", message=\".*lr_patience.*\")\n", |
89 | | - "warnings.filterwarnings(\"ignore\", message=\".*Checkpoint directory.*\")\n", |
90 | | - "warnings.filterwarnings(\"ignore\", message=\".*logging interval.*\")\n", |
91 | | - "warnings.filterwarnings(\"ignore\", message=\".*IProgress not found.*\")\n", |
92 | | - "\n", |
93 | | - "# Lightning prints a device banner and a parameter-count table on every fit.\n", |
94 | | - "# They are useful in isolation but drown out the observability messages this\n", |
95 | | - "# tutorial is about, so raise these loggers to ERROR. DeepTab's own events are\n", |
96 | | - "# emitted separately and are unaffected.\n", |
97 | | - "for _name in (\n", |
98 | | - " \"lightning\",\n", |
99 | | - " \"lightning.pytorch\",\n", |
100 | | - " \"lightning.pytorch.callbacks.model_summary\",\n", |
101 | | - " \"lightning.pytorch.utilities.rank_zero\",\n", |
102 | | - " \"lightning.pytorch.accelerators\",\n", |
103 | | - " \"pytorch_lightning\",\n", |
104 | | - "):\n", |
105 | | - " logging.getLogger(_name).setLevel(logging.ERROR)" |
| 85 | + "warnings.filterwarnings(\"ignore\")\n", |
| 86 | + "logging.getLogger(\"lightning.pytorch\").setLevel(logging.ERROR)\n" |
106 | 87 | ] |
107 | 88 | }, |
108 | 89 | { |
|
1127 | 1108 | "Your sink received the full event stream with its structured payloads, ready to forward to whatever backend you use. Because no `ObservabilityConfig` was attached, DeepTab created no run directory of its own: your code is in full control." |
1128 | 1109 | ] |
1129 | 1110 | }, |
1130 | | - { |
1131 | | - "cell_type": "markdown", |
1132 | | - "id": "c9833541", |
1133 | | - "metadata": {}, |
1134 | | - "source": [ |
1135 | | - "## 8. Side-by-side: what each configuration leaves on disk\n", |
1136 | | - "\n", |
1137 | | - "The trees below are the canonical shapes you can expect. Timestamps and ids vary per run; the structure does not.\n", |
1138 | | - "\n", |
1139 | | - "**No observability** — only the best-weights checkpoint:\n", |
1140 | | - "\n", |
1141 | | - "```text\n", |
1142 | | - "01_no_observability/\n", |
1143 | | - " checkpoints/\n", |
1144 | | - " best_model.ckpt\n", |
1145 | | - "```\n", |
1146 | | - "\n", |
1147 | | - "**Minimal `ObservabilityConfig`** — self-describing run directory:\n", |
1148 | | - "\n", |
1149 | | - "```text\n", |
1150 | | - "02_minimal/\n", |
1151 | | - " runs/demo/<timestamp>_<run_id>/\n", |
1152 | | - " config.yaml # full estimator configuration\n", |
1153 | | - " summary.json # final metrics\n", |
1154 | | - " artifacts/ # reserved for run artifacts\n", |
1155 | | - " checkpoints/\n", |
1156 | | - " best_model.ckpt\n", |
1157 | | - "```\n", |
1158 | | - "\n", |
1159 | | - "**`structured_logging=True, log_to_file=True`** — adds the event log:\n", |
1160 | | - "\n", |
1161 | | - "```text\n", |
1162 | | - "04_with_file/\n", |
1163 | | - " runs/demo/<timestamp>_<run_id>/\n", |
1164 | | - " config.yaml\n", |
1165 | | - " lifecycle.jsonl # one JSON event per line\n", |
1166 | | - " summary.json\n", |
1167 | | - " artifacts/\n", |
1168 | | - " checkpoints/\n", |
1169 | | - " best_model.ckpt\n", |
1170 | | - "```\n", |
1171 | | - "\n", |
1172 | | - "**`experiment_trackers=[\"tensorboard\"]`** — adds a TensorBoard tree:\n", |
1173 | | - "\n", |
1174 | | - "```text\n", |
1175 | | - "06_tensorboard/\n", |
1176 | | - " runs/demo/<timestamp>_<run_id>/\n", |
1177 | | - " config.yaml\n", |
1178 | | - " summary.json\n", |
1179 | | - " artifacts/\n", |
1180 | | - " checkpoints/best_model.ckpt\n", |
1181 | | - " tensorboard/demo/<timestamp>_<run_id>/\n", |
1182 | | - " events.out.tfevents...\n", |
1183 | | - " hparams.yaml\n", |
1184 | | - "```\n", |
1185 | | - "\n", |
1186 | | - "**`experiment_trackers=[\"mlflow\"]`** — adds a local MLflow store:\n", |
1187 | | - "\n", |
1188 | | - "```text\n", |
1189 | | - "07_mlflow/\n", |
1190 | | - " runs/demo/<timestamp>_<run_id>/\n", |
1191 | | - " config.yaml\n", |
1192 | | - " summary.json\n", |
1193 | | - " artifacts/\n", |
1194 | | - " checkpoints/best_model.ckpt\n", |
1195 | | - " mlflow/\n", |
1196 | | - " backend/mlflow.db # run metadata (SQLite)\n", |
1197 | | - " artifacts/<mlflow_run_id>/artifacts/\n", |
1198 | | - " config.yaml\n", |
1199 | | - " summary.json\n", |
1200 | | - " best_model/... # logged model checkpoint\n", |
1201 | | - " checkpoints/best_model.ckpt\n", |
1202 | | - "```\n", |
1203 | | - "\n", |
1204 | | - "**`logger=...` + a tracker** — your Lightning logger sits beside DeepTab's trees:\n", |
1205 | | - "\n", |
1206 | | - "```text\n", |
1207 | | - "08_byo_logger/\n", |
1208 | | - " csv/mlp/version_0/\n", |
1209 | | - " hparams.yaml\n", |
1210 | | - " metrics.csv\n", |
1211 | | - " runs/demo/<timestamp>_<run_id>/...\n", |
1212 | | - " tensorboard/demo/<timestamp>_<run_id>/...\n", |
1213 | | - "```" |
1214 | | - ] |
1215 | | - }, |
1216 | 1111 | { |
1217 | 1112 | "cell_type": "markdown", |
1218 | 1113 | "id": "92b61374", |
|
1263 | 1158 | ], |
1264 | 1159 | "metadata": { |
1265 | 1160 | "kernelspec": { |
1266 | | - "display_name": ".venv", |
| 1161 | + "display_name": "Python 3", |
1267 | 1162 | "language": "python", |
1268 | 1163 | "name": "python3" |
1269 | 1164 | }, |
|
0 commit comments