Skip to content

Commit

Permalink
fix log error in tutorials (close #25)
Browse files Browse the repository at this point in the history
  • Loading branch information
luigibonati authored Mar 23, 2023
1 parent fed0723 commit 5b940a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/notebooks/2d-model_discriminant.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@
"source": [
"fig, ax = plt.subplots(figsize=(5,4),dpi=100)\n",
"\n",
"loss_train = [x for x in model.loss_train]\n",
"loss_valid = [x for x in model.loss_valid]\n",
"loss_train = [x for x in model.logs['loss_train']]\n",
"loss_valid = [x for x in model.logs['loss_valid']]\n",
"\n",
"# Loss function\n",
"ax.plot(loss_train,'-',label='Train')\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/2d-model_tica.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@
"source": [
"fig, ax = plt.subplots(figsize=(5,4),dpi=100)\n",
"\n",
"loss_train = [x.cpu() for x in model.loss_train]\n",
"loss_valid = [x.cpu() for x in model.loss_valid]\n",
"loss_train = [x for x in model.logs['loss_train']]\n",
"loss_valid = [x for x in model.logs['loss_valid']]\n",
"\n",
"# Loss function\n",
"ax.plot(loss_train,'-',label='Train')\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/ala2_deeplda.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@
"source": [
"fig, ax = plt.subplots(figsize=(5,4),dpi=100)\n",
"\n",
"loss_train = [x.cpu() for x in model.loss_train]\n",
"loss_valid = [x.cpu() for x in model.loss_valid]\n",
"loss_train = [x for x in model.logs['loss_train']]\n",
"loss_valid = [x for x in model.logs['loss_valid']]\n",
"\n",
"# Loss function\n",
"ax.plot(loss_train,'-',label='Train')\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/notebooks/ala2_deeptica_multithermal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@
"source": [
"fig, axs = plt.subplots(1,2,figsize=(12,5),dpi=100)\n",
"\n",
"loss_train = [x.cpu() for x in model.loss_train]\n",
"loss_valid = [x.cpu() for x in model.loss_valid]\n",
"loss_train = [x for x in model.logs['loss_train']]\n",
"loss_valid = [x for x in model.logs['loss_valid']]\n",
"\n",
"# Loss function\n",
"ax = axs[0]\n",
Expand All @@ -514,7 +514,7 @@
"# Eigenvalues vs epoch\n",
"ax = axs[1]\n",
"with torch.no_grad():\n",
" evals_train = np.asarray(torch.cat(model.evals_train).cpu())\n",
" evals_train = np.asarray(model.logs['tica_eigvals'])\n",
"for i in range(n_eig):\n",
" ax.plot(evals_train[:,i],label='Eig. '+str(i+1))\n",
"ax.set_ylabel('Eigenvalues')\n",
Expand Down

0 comments on commit 5b940a3

Please sign in to comment.