示例#1
0
文件: base_scaled.py 项目: 1pkg/neura
 def train(
         self,
         bundle,
         bundle_size=32,
         steps_per_epoch=128,
         epochs=8,
         verbose=True,
         scale_factor=4,
 ):
     loader = Loader(bundle, scale_factor, Image.BICUBIC)
     history = self.model().fit_generator(
         loader.gen_data_train(bundle_size),
         steps_per_epoch=steps_per_epoch,
         epochs=epochs,
         verbose=verbose,
     )
     path_history = path.join(self._path_history, self.name() + '.hi')
     with open(path_history, 'wb') as file_hi:
         dump(history.history, file_hi)
示例#2
0
 def train(
         self,
         bundle,
         bundle_size=32,
         steps_per_epoch=128,
         epochs=8,
         verbose=True,
 ):
     loader = Loader(bundle)
     history = self.model().fit_generator(
         loader.gen_data_train(bundle_size),
         steps_per_epoch=steps_per_epoch,
         epochs=epochs,
         verbose=verbose,
         validation_data=loader.gen_data_test(bundle_size),
         validation_steps=steps_per_epoch,
     )
     path_history = path.join(self._path_history, self.name() + '.hi')
     with open(path_history, 'wb') as file_hi:
         dump(history.history, file_hi)