Skip to content

Commit 6069c87

Browse files
committed
Code simplication following code review.
1 parent 4271d5d commit 6069c87

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

code/logistic_sgd.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,7 @@ def load_data(dataset):
159159
data_dir, data_file = os.path.split(dataset)
160160
if data_dir == "" and not os.path.isfile(dataset):
161161
# Check if dataset is in the data directory.
162-
new_path = os.path.split(__file__)
163-
if new_path[0] == "":
164-
new_path = os.path.join('..', "data", dataset)
165-
else:
166-
new_path = os.path.join(os.path.split(os.path.split(__file__)[0])[0],
167-
"data", dataset)
162+
new_path = os.path.join(os.path.split(__file__)[0], "..", "data", dataset)
168163
if os.path.isfile(new_path) or data_file == 'mnist.pkl.gz':
169164
dataset = new_path
170165

0 commit comments

Comments
 (0)