Skip to content

Commit

Permalink
Merge pull request #8 from anthony-wang/Fix-path-slash
Browse files Browse the repository at this point in the history
Fix path (slash)
  • Loading branch information
anthony-wang committed Jun 21, 2021
2 parents 1271f11 + dcc3649 commit 9e0d79c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions benchmark_crabnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def get_model(mat_prop, classification=False, batch_size=None,
model.classification = True

# Get the datafiles you will learn from
train_data = rf'data\benchmark_data\{mat_prop}\train.csv'
val_data = rf'data\benchmark_data\{mat_prop}\val.csv'
train_data = f'data/benchmark_data/{mat_prop}/train.csv'
val_data = f'data/benchmark_data/{mat_prop}/val.csv'

# Load the train and validation data before fitting the network
data_size = pd.read_csv(train_data).shape[0]
Expand Down Expand Up @@ -79,7 +79,7 @@ def load_model(mat_prop, classification, file_name, verbose=True):
model.classification = True

# Load the data you want to predict with
data = rf'data\benchmark_data\{mat_prop}\{file_name}'
data = f'data/benchmark_data/{mat_prop}/{file_name}'
# data is reloaded to model.data_loader
model.load_data(data, batch_size=2**9, train=False)
return model
Expand Down
6 changes: 3 additions & 3 deletions matbench_crabnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def get_model(mat_prop, i, classification=False, batch_size=None,
model.classification = True

# Get the datafiles you will learn from
train_data = rf'data\matbench_cv\{mat_prop}\train{i}.csv'
val_data = rf'data\matbench_cv\{mat_prop}\val{i}.csv'
train_data = f'data/matbench_cv/{mat_prop}/train{i}.csv'
val_data = f'data/matbench_cv/{mat_prop}/val{i}.csv'

# Load the train and validation data before fitting the network
data_size = pd.read_csv(train_data).shape[0]
Expand Down Expand Up @@ -79,7 +79,7 @@ def load_model(mat_prop, i, classification, file_name, verbose=True):
model.classification = True

# Load the data you want to predict with
data = rf'data\matbench_cv\{mat_prop}\{file_name}'
data = f'data/matbench_cv/{mat_prop}/{file_name}'
# data is reloaded to model.data_loader
model.load_data(data, batch_size=2**9)
return model
Expand Down
8 changes: 4 additions & 4 deletions train_crabnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ def get_model(data_dir, mat_prop, classification=False, batch_size=None,
model.classification = True

# Get the datafiles you will learn from
train_data = rf'{data_dir}\{mat_prop}\train.csv'
train_data = f'{data_dir}/{mat_prop}/train.csv'
try:
val_data = rf'{data_dir}\{mat_prop}\val.csv'
val_data = f'{data_dir}/{mat_prop}/val.csv'
except:
print('Please ensure you have train (train.csv) and validation data',
f'(val.csv) in folder "data\materials_data\{mat_prop}"')
f'(val.csv) in folder "data/materials_data/{mat_prop}"')

# Load the train and validation data before fitting the network
data_size = pd.read_csv(train_data).shape[0]
Expand Down Expand Up @@ -80,7 +80,7 @@ def load_model(data_dir, mat_prop, classification, file_name, verbose=True):
model.classification = True

# Load the data you want to predict with
data = rf'{data_dir}\{mat_prop}\{file_name}'
data = f'{data_dir}/{mat_prop}/{file_name}'
# data is reloaded to model.data_loader
model.load_data(data, batch_size=2**9, train=False)
return model
Expand Down

0 comments on commit 9e0d79c

Please sign in to comment.