Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bruAristimunha committed Sep 19, 2023
1 parent 914dd31 commit 2ceb43c
Show file tree
Hide file tree
Showing 214 changed files with 10,315 additions and 7,057 deletions.
2 changes: 1 addition & 1 deletion dev/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 4fbaa04548315a8ff6a67c8a0ecd0345
config: ca886995c354df0aedd5fbce8123c945
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@
df = df.assign(train_misclass=100 - 100 * df.train_accuracy,
valid_misclass=100 - 100 * df.valid_accuracy)

plt.style.use('seaborn')
fig, ax1 = plt.subplots(figsize=(8, 3))
df.loc[:, ['train_loss', 'valid_loss']].plot(
ax=ax1, style=['-', ':'], marker='o', color='tab:blue', legend=False, fontsize=14)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom matplotlib.lines import Line2D\n\nplt.style.use('seaborn')\nfig, axes = plt.subplots(3, 1, figsize=(8, 9))\n\naxes[0].set_title('Training dataset')\naxes[0].plot(np.arange(y_train.shape[0]) / target_sfreq, y_train[:, 0], label='Target')\naxes[0].plot(np.arange(preds_train.shape[0]) / target_sfreq, preds_train[:, 0],\n label='Predicted')\naxes[0].set_ylabel('Finger flexion')\naxes[0].legend()\n\naxes[1].set_title('Validation dataset')\naxes[1].plot(np.arange(y_valid.shape[0]) / target_sfreq, y_valid[:, 0], label='Target')\naxes[1].plot(np.arange(preds_valid.shape[0]) / target_sfreq, preds_valid[:, 0],\n label='Predicted')\naxes[1].set_ylabel('Finger flexion')\naxes[1].legend()\n\naxes[2].set_title('Test dataset')\naxes[2].plot(np.arange(y_test.shape[0]) / target_sfreq, y_test[:, 0], label='Target')\naxes[2].plot(np.arange(preds_test.shape[0]) / target_sfreq, preds_test[:, 0], label='Predicted')\naxes[2].set_xlabel('Time [s]')\naxes[2].set_ylabel('Finger flexion')\naxes[2].legend()\nplt.tight_layout()"
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom matplotlib.lines import Line2D\n\nfig, axes = plt.subplots(3, 1, figsize=(8, 9))\n\naxes[0].set_title('Training dataset')\naxes[0].plot(np.arange(y_train.shape[0]) / target_sfreq, y_train[:, 0], label='Target')\naxes[0].plot(np.arange(preds_train.shape[0]) / target_sfreq, preds_train[:, 0],\n label='Predicted')\naxes[0].set_ylabel('Finger flexion')\naxes[0].legend()\n\naxes[1].set_title('Validation dataset')\naxes[1].plot(np.arange(y_valid.shape[0]) / target_sfreq, y_valid[:, 0], label='Target')\naxes[1].plot(np.arange(preds_valid.shape[0]) / target_sfreq, preds_valid[:, 0],\n label='Predicted')\naxes[1].set_ylabel('Finger flexion')\naxes[1].legend()\n\naxes[2].set_title('Test dataset')\naxes[2].plot(np.arange(y_test.shape[0]) / target_sfreq, y_test[:, 0], label='Target')\naxes[2].plot(np.arange(preds_test.shape[0]) / target_sfreq, preds_test[:, 0], label='Predicted')\naxes[2].set_xlabel('Time [s]')\naxes[2].set_ylabel('Finger flexion')\naxes[2].legend()\nplt.tight_layout()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ def fake_regression_dataset(n_fake_recs, n_fake_chs, fake_sfreq,
# Plotting training and validation losses and negative root mean square error
import matplotlib.pyplot as plt

plt.style.use("seaborn")

fig, axes = plt.subplots(1, 2, figsize=(10, 5))
axes[0].set_title("Train and valid losses")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom matplotlib.lines import Line2D\n\n# Extract loss and accuracy values for plotting from history object\nresults_columns = ['train_loss', 'valid_loss', 'train_accuracy', 'valid_accuracy']\ndf = pd.DataFrame(clf.history[:, results_columns], columns=results_columns,\n index=clf.history[:, 'epoch'])\n\n# get percent of misclass for better visual comparison to loss\ndf = df.assign(train_misclass=100 - 100 * df.train_accuracy,\n valid_misclass=100 - 100 * df.valid_accuracy)\n\nplt.style.use('seaborn')\nfig, ax1 = plt.subplots(figsize=(8, 3))\ndf.loc[:, ['train_loss', 'valid_loss']].plot(\n ax=ax1, style=['-', ':'], marker='o', color='tab:blue', legend=False, fontsize=14)\n\nax1.tick_params(axis='y', labelcolor='tab:blue', labelsize=14)\nax1.set_ylabel(\"Loss\", color='tab:blue', fontsize=14)\n\nax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis\n\ndf.loc[:, ['train_misclass', 'valid_misclass']].plot(\n ax=ax2, style=['-', ':'], marker='o', color='tab:red', legend=False)\nax2.tick_params(axis='y', labelcolor='tab:red', labelsize=14)\nax2.set_ylabel(\"Misclassification Rate [%]\", color='tab:red', fontsize=14)\nax2.set_ylim(ax2.get_ylim()[0], 85) # make some room for legend\nax1.set_xlabel(\"Epoch\", fontsize=14)\n\n# where some data has already been plotted to ax\nhandles = []\nhandles.append(Line2D([0], [0], color='black', linewidth=1, linestyle='-', label='Train'))\nhandles.append(Line2D([0], [0], color='black', linewidth=1, linestyle=':', label='Valid'))\nplt.legend(handles, [h.get_label() for h in handles], fontsize=14)\nplt.tight_layout()"
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom matplotlib.lines import Line2D\n\n# Extract loss and accuracy values for plotting from history object\nresults_columns = ['train_loss', 'valid_loss', 'train_accuracy', 'valid_accuracy']\ndf = pd.DataFrame(clf.history[:, results_columns], columns=results_columns,\n index=clf.history[:, 'epoch'])\n\n# get percent of misclass for better visual comparison to loss\ndf = df.assign(train_misclass=100 - 100 * df.train_accuracy,\n valid_misclass=100 - 100 * df.valid_accuracy)\n\nfig, ax1 = plt.subplots(figsize=(8, 3))\ndf.loc[:, ['train_loss', 'valid_loss']].plot(\n ax=ax1, style=['-', ':'], marker='o', color='tab:blue', legend=False, fontsize=14)\n\nax1.tick_params(axis='y', labelcolor='tab:blue', labelsize=14)\nax1.set_ylabel(\"Loss\", color='tab:blue', fontsize=14)\n\nax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis\n\ndf.loc[:, ['train_misclass', 'valid_misclass']].plot(\n ax=ax2, style=['-', ':'], marker='o', color='tab:red', legend=False)\nax2.tick_params(axis='y', labelcolor='tab:red', labelsize=14)\nax2.set_ylabel(\"Misclassification Rate [%]\", color='tab:red', fontsize=14)\nax2.set_ylim(ax2.get_ylim()[0], 85) # make some room for legend\nax1.set_xlabel(\"Epoch\", fontsize=14)\n\n# where some data has already been plotted to ax\nhandles = []\nhandles.append(Line2D([0], [0], color='black', linewidth=1, linestyle='-', label='Train'))\nhandles.append(Line2D([0], [0], color='black', linewidth=1, linestyle=':', label='Valid'))\nplt.legend(handles, [h.get_label() for h in handles], fontsize=14)\nplt.tight_layout()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"outputs": [],
"source": [
"# Author: Lukas Gemein <[email protected]>\n#\n# License: BSD (3-clause)\n\nimport tempfile\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport mne\n\nfrom braindecode.datasets import TUH\nfrom braindecode.preprocessing import (\n preprocess, Preprocessor, create_fixed_length_windows, scale as multiply)\n\nplt.style.use('seaborn')\nmne.set_log_level('ERROR') # avoid messages everytime a window is extracted"
"# Author: Lukas Gemein <[email protected]>\n#\n# License: BSD (3-clause)\n\nimport tempfile\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport mne\n\nfrom braindecode.datasets import TUH\nfrom braindecode.preprocessing import (\n preprocess, Preprocessor, create_fixed_length_windows, scale as multiply)\n\nmne.set_log_level('ERROR') # avoid messages everytime a window is extracted"
]
},
{
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n\nplt.style.use(\"seaborn\")\n\nfig, axes = plt.subplots(1, 2, figsize=(10, 5))\naxes[0].set_title(\"Train and valid losses\")\naxes[0].plot(regressor.history[:, \"train_loss\"])\naxes[0].plot(regressor.history[:, \"valid_loss\"])\naxes[0].set_xlabel(\"Epochs\")\naxes[0].set_ylabel(\"Cropped MSE loss\")\naxes[0].legend([\"Train\", \"Valid\"])\n\naxes[1].set_title(\"Train and valid errors\")\naxes[1].plot(regressor.history[:, \"train_neg_root_mean_squared_error\"])\naxes[1].plot(regressor.history[:, \"valid_neg_root_mean_squared_error\"])\naxes[1].set_xlabel(\"Epochs\")\naxes[1].set_ylabel(\"Negative RMSE\")\naxes[1].legend([\"Train\", \"Valid\"])"
"import matplotlib.pyplot as plt\n\n\nfig, axes = plt.subplots(1, 2, figsize=(10, 5))\naxes[0].set_title(\"Train and valid losses\")\naxes[0].plot(regressor.history[:, \"train_loss\"])\naxes[0].plot(regressor.history[:, \"valid_loss\"])\naxes[0].set_xlabel(\"Epochs\")\naxes[0].set_ylabel(\"Cropped MSE loss\")\naxes[0].legend([\"Train\", \"Valid\"])\n\naxes[1].set_title(\"Train and valid errors\")\naxes[1].plot(regressor.history[:, \"train_neg_root_mean_squared_error\"])\naxes[1].plot(regressor.history[:, \"valid_neg_root_mean_squared_error\"])\naxes[1].set_xlabel(\"Epochs\")\naxes[1].set_ylabel(\"Negative RMSE\")\naxes[1].legend([\"Train\", \"Valid\"])"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ def pearson_r_score(net, dataset, y):
import pandas as pd
from matplotlib.lines import Line2D

plt.style.use('seaborn')
fig, axes = plt.subplots(3, 1, figsize=(8, 9))

axes[0].set_title('Training dataset')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom matplotlib.lines import Line2D\n\n# Extract loss and accuracy values for plotting from history object\nresults_columns = ['train_loss', 'valid_loss', 'train_accuracy', 'valid_accuracy']\ndf = pd.DataFrame(clf.history[:, results_columns], columns=results_columns,\n index=clf.history[:, 'epoch'])\n\n# get percent of misclass for better visual comparison to loss\ndf = df.assign(train_misclass=100 - 100 * df.train_accuracy,\n valid_misclass=100 - 100 * df.valid_accuracy)\n\nplt.style.use('seaborn')\nfig, ax1 = plt.subplots(figsize=(8, 3))\ndf.loc[:, ['train_loss', 'valid_loss']].plot(\n ax=ax1, style=['-', ':'], marker='o', color='tab:blue', legend=False, fontsize=14)\n\nax1.tick_params(axis='y', labelcolor='tab:blue', labelsize=14)\nax1.set_ylabel(\"Loss\", color='tab:blue', fontsize=14)\n\nax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis\n\ndf.loc[:, ['train_misclass', 'valid_misclass']].plot(\n ax=ax2, style=['-', ':'], marker='o', color='tab:red', legend=False)\nax2.tick_params(axis='y', labelcolor='tab:red', labelsize=14)\nax2.set_ylabel(\"Misclassification Rate [%]\", color='tab:red', fontsize=14)\nax2.set_ylim(ax2.get_ylim()[0], 85) # make some room for legend\nax1.set_xlabel(\"Epoch\", fontsize=14)\n\n# where some data has already been plotted to ax\nhandles = []\nhandles.append(Line2D([0], [0], color='black', linewidth=1, linestyle='-', label='Train'))\nhandles.append(Line2D([0], [0], color='black', linewidth=1, linestyle=':', label='Valid'))\nplt.legend(handles, [h.get_label() for h in handles], fontsize=14)\nplt.tight_layout()"
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom matplotlib.lines import Line2D\n\n# Extract loss and accuracy values for plotting from history object\nresults_columns = ['train_loss', 'valid_loss', 'train_accuracy', 'valid_accuracy']\ndf = pd.DataFrame(clf.history[:, results_columns], columns=results_columns,\n index=clf.history[:, 'epoch'])\n\n# get percent of misclass for better visual comparison to loss\ndf = df.assign(train_misclass=100 - 100 * df.train_accuracy,\n valid_misclass=100 - 100 * df.valid_accuracy)\n\nfig, ax1 = plt.subplots(figsize=(8, 3))\ndf.loc[:, ['train_loss', 'valid_loss']].plot(\n ax=ax1, style=['-', ':'], marker='o', color='tab:blue', legend=False, fontsize=14)\n\nax1.tick_params(axis='y', labelcolor='tab:blue', labelsize=14)\nax1.set_ylabel(\"Loss\", color='tab:blue', fontsize=14)\n\nax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis\n\ndf.loc[:, ['train_misclass', 'valid_misclass']].plot(\n ax=ax2, style=['-', ':'], marker='o', color='tab:red', legend=False)\nax2.tick_params(axis='y', labelcolor='tab:red', labelsize=14)\nax2.set_ylabel(\"Misclassification Rate [%]\", color='tab:red', fontsize=14)\nax2.set_ylim(ax2.get_ylim()[0], 85) # make some room for legend\nax1.set_xlabel(\"Epoch\", fontsize=14)\n\n# where some data has already been plotted to ax\nhandles = []\nhandles.append(Line2D([0], [0], color='black', linewidth=1, linestyle='-', label='Train'))\nhandles.append(Line2D([0], [0], color='black', linewidth=1, linestyle=':', label='Valid'))\nplt.legend(handles, [h.get_label() for h in handles], fontsize=14)\nplt.tight_layout()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom matplotlib.lines import Line2D\n\nplt.style.use('seaborn')\nfig, axes = plt.subplots(3, 1, figsize=(8, 9))\n\naxes[0].set_title('Training dataset')\naxes[0].plot(np.arange(0, y_train.shape[0]) / target_sfreq, y_train[:, 0], label='Target')\naxes[0].plot(np.arange(0, preds_train.shape[0]) / target_sfreq, preds_train[:, 0],\n label='Predicted')\naxes[0].set_ylabel('Finger flexion')\naxes[0].legend()\n\naxes[1].set_title('Validation dataset')\naxes[1].plot(np.arange(0, y_valid.shape[0]) / target_sfreq, y_valid[:, 0], label='Target')\naxes[1].plot(np.arange(0, preds_valid.shape[0]) / target_sfreq, preds_valid[:, 0],\n label='Predicted')\naxes[1].set_ylabel('Finger flexion')\naxes[1].legend()\n\naxes[2].set_title('Test dataset')\naxes[2].plot(np.arange(0, y_test.shape[0]) / target_sfreq, y_test[:, 0], label='Target')\naxes[2].plot(np.arange(0, preds_test.shape[0]) / target_sfreq, preds_test[:, 0], label='Predicted')\naxes[2].set_xlabel('Time [s]')\naxes[2].set_ylabel('Finger flexion')\naxes[2].legend()\nplt.tight_layout()"
"import matplotlib.pyplot as plt\nimport pandas as pd\nfrom matplotlib.lines import Line2D\n\nfig, axes = plt.subplots(3, 1, figsize=(8, 9))\n\naxes[0].set_title('Training dataset')\naxes[0].plot(np.arange(0, y_train.shape[0]) / target_sfreq, y_train[:, 0], label='Target')\naxes[0].plot(np.arange(0, preds_train.shape[0]) / target_sfreq, preds_train[:, 0],\n label='Predicted')\naxes[0].set_ylabel('Finger flexion')\naxes[0].legend()\n\naxes[1].set_title('Validation dataset')\naxes[1].plot(np.arange(0, y_valid.shape[0]) / target_sfreq, y_valid[:, 0], label='Target')\naxes[1].plot(np.arange(0, preds_valid.shape[0]) / target_sfreq, preds_valid[:, 0],\n label='Predicted')\naxes[1].set_ylabel('Finger flexion')\naxes[1].legend()\n\naxes[2].set_title('Test dataset')\naxes[2].plot(np.arange(0, y_test.shape[0]) / target_sfreq, y_test[:, 0], label='Target')\naxes[2].plot(np.arange(0, preds_test.shape[0]) / target_sfreq, preds_test[:, 0], label='Predicted')\naxes[2].set_xlabel('Time [s]')\naxes[2].set_ylabel('Finger flexion')\naxes[2].legend()\nplt.tight_layout()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\nimport pandas as pd\n\n# Extract loss and balanced accuracy values for plotting from history object\ndf = pd.DataFrame(clf.history.to_list())\n\ndf['train_acc'] *= 100\ndf['valid_acc'] *= 100\n\nys1 = ['train_loss', 'valid_loss']\nys2 = ['train_acc', 'valid_acc']\nstyles = ['-', ':']\nmarkers = ['.', '.']\n\nplt.style.use('seaborn-talk')\n\nfig, ax1 = plt.subplots(figsize=(8, 3))\nax2 = ax1.twinx()\nfor y1, y2, style, marker in zip(ys1, ys2, styles, markers):\n ax1.plot(df['epoch'], df[y1], ls=style, marker=marker, ms=7,\n c='tab:blue', label=y1)\n ax2.plot(df['epoch'], df[y2], ls=style, marker=marker, ms=7,\n c='tab:orange', label=y2)\n\nax1.tick_params(axis='y', labelcolor='tab:blue')\nax1.set_ylabel('Loss', color='tab:blue')\nax2.tick_params(axis='y', labelcolor='tab:orange')\nax2.set_ylabel('Accuracy [%]', color='tab:orange')\nax1.set_xlabel('Epoch')\n\nlines1, labels1 = ax1.get_legend_handles_labels()\nlines2, labels2 = ax2.get_legend_handles_labels()\nax2.legend(lines1 + lines2, labels1 + labels2)\n\nplt.tight_layout()"
"import matplotlib.pyplot as plt\nimport pandas as pd\n\n# Extract loss and balanced accuracy values for plotting from history object\ndf = pd.DataFrame(clf.history.to_list())\n\ndf['train_acc'] *= 100\ndf['valid_acc'] *= 100\n\nys1 = ['train_loss', 'valid_loss']\nys2 = ['train_acc', 'valid_acc']\nstyles = ['-', ':']\nmarkers = ['.', '.']\n\n\nfig, ax1 = plt.subplots(figsize=(8, 3))\nax2 = ax1.twinx()\nfor y1, y2, style, marker in zip(ys1, ys2, styles, markers):\n ax1.plot(df['epoch'], df[y1], ls=style, marker=marker, ms=7,\n c='tab:blue', label=y1)\n ax2.plot(df['epoch'], df[y2], ls=style, marker=marker, ms=7,\n c='tab:orange', label=y2)\n\nax1.tick_params(axis='y', labelcolor='tab:blue')\nax1.set_ylabel('Loss', color='tab:blue')\nax2.tick_params(axis='y', labelcolor='tab:orange')\nax2.set_ylabel('Accuracy [%]', color='tab:orange')\nax1.set_xlabel('Epoch')\n\nlines1, labels1 = ax1.get_legend_handles_labels()\nlines2, labels2 = ax2.get_legend_handles_labels()\nax2.legend(lines1 + lines2, labels1 + labels2)\n\nplt.tight_layout()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ def forward(self, x):
styles = ['-', ':']
markers = ['.', '.']

plt.style.use('seaborn-talk')

fig, ax1 = plt.subplots(figsize=(8, 3))
ax2 = ax1.twinx()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ def pad_and_select_predictions(preds, y):
import pandas as pd
from matplotlib.lines import Line2D

plt.style.use('seaborn')
fig, axes = plt.subplots(3, 1, figsize=(8, 9))

axes[0].set_title('Training dataset')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@
df = df.assign(train_misclass=100 - 100 * df.train_accuracy,
valid_misclass=100 - 100 * df.valid_accuracy)

plt.style.use('seaborn')
fig, ax1 = plt.subplots(figsize=(8, 3))
df.loc[:, ['train_loss', 'valid_loss']].plot(
ax=ax1, style=['-', ':'], marker='o', color='tab:blue', legend=False, fontsize=14)
Expand Down
Loading

0 comments on commit 2ceb43c

Please sign in to comment.