Commit 4f8883f3 authored by sjjsmuel's avatar sjjsmuel

shuffle and optimizer

parent e13d1751
......@@ -191,10 +191,10 @@ class DataLoader(object):
lambda: (x, y)), num_parallel_calls=self.NR_THREADS)
self.dataset_2 = self.dataset_2.map(lambda x, y: (tf.clip_by_value(x, 0, 1), y))
self.dataset_1 = self.dataset_1.repeat(self.dataset_1_repeat_factor).batch(self.batch_size, drop_remainder=True).prefetch(tf.data.experimental.AUTOTUNE)
self.dataset_1 = self.dataset_1.repeat(self.dataset_1_repeat_factor).shuffle(self.dataset_1_size*self.dataset_1_repeat_factor).batch(self.batch_size, drop_remainder=True).prefetch(tf.data.experimental.AUTOTUNE)
if self.dataset_2:
self.dataset_2 = self.dataset_2.repeat(self.dataset_2_repeat_factor).batch(self.batch_size, drop_remainder=True).prefetch(tf.data.experimental.AUTOTUNE)
self.dataset_2 = self.dataset_2.repeat(self.dataset_2_repeat_factor).shuffle(self.dataset_2_size*self.dataset_2_repeat_factor).batch(self.batch_size, drop_remainder=True).prefetch(tf.data.experimental.AUTOTUNE)
return self.dataset_1, self.dataset_2
else:
return self.dataset_1
......@@ -92,8 +92,8 @@ model = network.get_model()
#compile the model
#model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
model.compile(optimizer=Adam(lr=0.000001), loss='categorical_crossentropy', metrics=['accuracy'])
model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
#model.compile(optimizer=Adam(lr=0.000001), loss='categorical_crossentropy', metrics=['accuracy'])
# Print Network summary
# model.summary()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment