File tree Expand file tree Collapse file tree 3 files changed +2514
-419
lines changed
Expand file tree Collapse file tree 3 files changed +2514
-419
lines changed Original file line number Diff line number Diff line change 515515 },
516516 {
517517 "cell_type": "code",
518- "execution_count": 19 ,
518+ "execution_count": null ,
519519 "metadata": {},
520520 "outputs": [
521521 {
12121212 " train_loss.append(running_loss / len(loader))\n",
12131213 " end_time = time.time()\n",
12141214 "\n",
1215- " print(f \"-\" * 10 + \"\\n\" + f\"Epoch {epoch + 1}/{epochs} : \"\n",
1215+ " print(\"-\" * 10 + \"\\n\" + f\"Epoch {epoch + 1}/{epochs} : \"\n",
12161216 " f\"Train loss: {train_loss[-1]:.4f}, \"\n",
12171217 " f\"Time taken: {timedelta(seconds=end_time - start_time)}\")\n",
12181218 "\n",
Original file line number Diff line number Diff line change 132132 },
133133 {
134134 "cell_type": "code",
135- "execution_count": 4 ,
135+ "execution_count": null ,
136136 "metadata": {},
137137 "outputs": [
138138 {
148148 " \"\"\"Select device where to perform the computations.\"\"\"\n",
149149 " if torch.cuda.is_available():\n",
150150 " return torch.device(\"cuda:0\")\n",
151- " ### elif torch.backends.mps.is_available():\n",
152- " ### return torch.device(\"mps\")\n",
151+ " elif torch.backends.mps.is_available():\n",
152+ " return torch.device(\"mps\")\n",
153153 " else:\n",
154154 " return torch.device(\"cpu\")\n",
155155 "\n",
523523 },
524524 {
525525 "cell_type": "code",
526- "execution_count": 18 ,
526+ "execution_count": null ,
527527 "metadata": {},
528528 "outputs": [
529529 {
12231223 " train_loss.append(running_loss / len(loader))\n",
12241224 " end_time = time.time()\n",
12251225 "\n",
1226- " print(f \"-\" * 10 + \"\\n\" + f\"Epoch {epoch + 1}/{epochs} : \"\n",
1226+ " print(\"-\" * 10 + \"\\n\" + f\"Epoch {epoch + 1}/{epochs} : \"\n",
12271227 " f\"Train loss: {train_loss[-1]:.4f}, \"\n",
12281228 " f\"Time taken: {timedelta(seconds=end_time - start_time)}\")\n",
12291229 "\n",
You can’t perform that action at this time.
0 commit comments