Skip to content

Commit bddee0c

Browse files
Shorna AlamShorna Alam
authored andcommitted
Merge branch 'with_comet' into 2024
adding the comet code to the existing 2024 branch
2 parents 844a316 + 85c2cdc commit bddee0c

8 files changed

+1951
-570
lines changed

lab1/Part1_TensorFlow.ipynb

Lines changed: 103 additions & 77 deletions
Large diffs are not rendered by default.

lab1/Part2_Music_Generation.ipynb

Lines changed: 100 additions & 91 deletions
Large diffs are not rendered by default.

lab1/solutions/Part1_TensorFlow_Solution.ipynb

Lines changed: 106 additions & 78 deletions
Large diffs are not rendered by default.

lab1/solutions/Part2_Music_Generation_Solution.ipynb

Lines changed: 466 additions & 95 deletions
Large diffs are not rendered by default.

lab2/Part1_MNIST.ipynb

Lines changed: 97 additions & 80 deletions
Large diffs are not rendered by default.

lab2/Part2_FaceDetection.ipynb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@
7575
},
7676
"outputs": [],
7777
"source": [
78+
"# Import Comet\n",
79+
"!pip install comet_ml\n",
80+
"import comet_ml\n",
81+
"comet_ml.init(project_name=\"6.s191lab2.2.1\")\n",
82+
"comet_model_1 = comet_ml.Experiment()\n",
83+
"\n",
7884
"# Import Tensorflow 2.0\n",
7985
"%tensorflow_version 2.x\n",
8086
"import tensorflow as tf\n",
@@ -300,9 +306,11 @@
300306
" x, y = loader.get_batch(batch_size)\n",
301307
" loss = standard_train_step(x, y)\n",
302308
"\n",
309+
" comet_model_1.log_metric(\"loss\", loss.numpy().mean(), idx)\n",
303310
" # Record the loss and plot the evolution of the loss as a function of training\n",
304311
" loss_history.append(loss.numpy().mean())\n",
305-
" plotter.plot(loss_history.get())"
312+
" plotter.plot(loss_history.get())\n",
313+
"comet_model_1.end()"
306314
]
307315
},
308316
{
@@ -756,6 +764,9 @@
756764
"source": [
757765
"### Training the SS-VAE ###\n",
758766
"\n",
767+
"comet_ml.init(project_name=\"6.s191lab2.2.2\")\n",
768+
"comet_model_2 = comet_ml.Experiment()\n",
769+
"\n",
759770
"# Hyperparameters\n",
760771
"batch_size = 32\n",
761772
"learning_rate = 5e-4\n",
@@ -806,10 +817,13 @@
806817
" (x, y) = loader.get_batch(batch_size)\n",
807818
" # loss optimization\n",
808819
" loss = ss_vae_train_step(x, y)\n",
820+
" comet_model_2.log_metric(\"loss\", loss, step=j)\n",
809821
" \n",
810822
" # plot the progress every 200 steps\n",
811823
" if j % 500 == 0: \n",
812-
" mdl.util.plot_sample(x, y, ss_vae)"
824+
" mdl.util.plot_sample(x, y, ss_vae)\n",
825+
" \n",
826+
"comet_model_2.end()"
813827
]
814828
},
815829
{

lab2/solutions/Part1_MNIST_Solution.ipynb

Lines changed: 577 additions & 84 deletions
Large diffs are not rendered by default.

lab2/solutions/Part2_FaceDetection_Solution.ipynb

Lines changed: 486 additions & 63 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)