Skip to content

Commit 2ab2352

Browse files
author
何宇健
committed
Update sys.path.append(...)
1 parent acfca4b commit 2ab2352

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

_Dist/NeuralNetworks/a_Introduction/Introduction.ipynb

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88
},
99
"outputs": [],
1010
"source": [
11+
"import os\n",
1112
"import sys\n",
13+
"root_path = os.path.abspath(\"../../../\")\n",
14+
"if root_path not in sys.path:\n",
15+
" sys.path.append(root_path)\n",
16+
"\n",
1217
"import time\n",
1318
"import numpy as np\n",
14-
"sys.path.append(\"../../../\")\n",
15-
"from Util.ProgressBar import ProgressBar\n",
19+
"\n",
1620
"from Util.Util import DataUtil\n",
17-
"from Util.Timing import Timing\n",
21+
"from Util.ProgressBar import ProgressBar\n",
1822
"\n",
1923
"train_num = 6000\n",
2024
"(x_train, y_train), (x_test, y_test) = DataUtil.get_dataset(\n",

_Dist/NeuralNetworks/b_TraditionalML/TraditionalML.ipynb

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
"metadata": {},
77
"outputs": [],
88
"source": [
9+
"import os\n",
910
"import sys\n",
11+
"root_path = os.path.abspath(\"../../../\")\n",
12+
"if root_path not in sys.path:\n",
13+
" sys.path.append(root_path)\n",
14+
"\n",
1015
"import numpy as np\n",
11-
"sys.path.append(\"../../../\")\n",
1216
"from Util.Util import DataUtil\n",
1317
"\n",
1418
"train_num = 6000\n",

0 commit comments

Comments
 (0)