Skip to content
Snippets Groups Projects
Commit 3b70d4a1 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent eaee2230
No related branches found
No related tags found
No related merge requests found
...@@ -235,7 +235,7 @@ class IcingIntensityNN: ...@@ -235,7 +235,7 @@ class IcingIntensityNN:
dataset = tf.data.Dataset.from_tensor_slices(indexes) dataset = tf.data.Dataset.from_tensor_slices(indexes)
dataset = dataset.batch(PROC_BATCH_SIZE) dataset = dataset.batch(PROC_BATCH_SIZE)
dataset = dataset.map(self.data_function, num_parallel_calls=8) dataset = dataset.map(self.data_function, num_parallel_calls=8)
dataset = dataset.shuffle(PROC_BATCH_BUFFER_SIZE) # dataset = dataset.shuffle(PROC_BATCH_BUFFER_SIZE)
dataset = dataset.prefetch(buffer_size=1) dataset = dataset.prefetch(buffer_size=1)
self.train_dataset = dataset self.train_dataset = dataset
...@@ -247,13 +247,13 @@ class IcingIntensityNN: ...@@ -247,13 +247,13 @@ class IcingIntensityNN:
dataset = dataset.map(self.data_function, num_parallel_calls=8) dataset = dataset.map(self.data_function, num_parallel_calls=8)
self.test_dataset = dataset self.test_dataset = dataset
def setup_pipeline(self, filename, trn_idxs=None, tst_idxs=None): def setup_pipeline(self, filename, trn_idxs=None, tst_idxs=None, seed=None):
self.filename = filename self.filename = filename
self.h5f = h5py.File(filename, 'r') self.h5f = h5py.File(filename, 'r')
if trn_idxs is None and tst_idxs is None: if trn_idxs is None and tst_idxs is None:
time = self.h5f['time'] time = self.h5f['time']
num_obs = time.shape[0] num_obs = time.shape[0]
trn_idxs, tst_idxs = split_data(num_obs) trn_idxs, tst_idxs = split_data(num_obs, seed=seed)
self.num_data_samples = trn_idxs.shape[0] self.num_data_samples = trn_idxs.shape[0]
self.get_train_dataset(trn_idxs) self.get_train_dataset(trn_idxs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment