simm
parent
470c4453ae
commit
dc8e27abe8
|
@ -58,6 +58,8 @@ class eNoseTrainer:
|
|||
|
||||
target_log = '{}/load-{}.log'.format(self.name, self.start)
|
||||
fh = logging.FileHandler(target_log)
|
||||
optuna.logging.enable_propagation() # Propagate logs to the root logger.
|
||||
optuna.logging.disable_default_handler() # Stop showing logs in sys.stderr.
|
||||
|
||||
self.debug = debug
|
||||
|
||||
|
@ -302,7 +304,7 @@ class eNoseTrainer:
|
|||
plt.close()
|
||||
|
||||
def fit(self):
|
||||
windows = [64, 128, 256,]
|
||||
windows = [32, 64, 128,]
|
||||
# windows = [128, 256, 384]
|
||||
total_train_queue = 2*int(1/self.ratio)*(len(self.get_model_train())+len(windows))
|
||||
self.logger.info("{:=^60}".format(f'Begin Fit {total_train_queue} Models'))
|
||||
|
@ -473,7 +475,7 @@ class eNoseTrainer:
|
|||
self.logger.debug(f"Y_train_sample: {Y_train_sample.shape}")
|
||||
self.logger.debug(f"Y_test_sample: {Y_test_sample.shape}")
|
||||
|
||||
best_model, study, best_batch_size = self.search_best_conv1D_v1(X_train_sample, X_test_sample, Y_train_sample, Y_test_sample, epochs=10, num_trials=32)
|
||||
best_model, study, best_batch_size = self.search_best_conv1D_v1(X_train_sample, X_test_sample, Y_train_sample, Y_test_sample, epochs=10, num_trials=10)
|
||||
# Save study results to an Excel file
|
||||
trials_data = []
|
||||
for trial in study.trials:
|
||||
|
@ -560,7 +562,7 @@ class eNoseTrainer:
|
|||
self.logger.debug(f"Y_train_sample: {Y_train_sample.shape}")
|
||||
self.logger.debug(f"Y_test_sample: {Y_test_sample.shape}")
|
||||
|
||||
best_model, study, best_batch_size = self.search_best_conv1D_v1(X_train_sample, X_test_sample, Y_train_sample, Y_test_sample, epochs=10, num_trials=32)
|
||||
best_model, study, best_batch_size = self.search_best_conv1D_v1(X_train_sample, X_test_sample, Y_train_sample, Y_test_sample, epochs=10, num_trials=10)
|
||||
# Save study results to an Excel file
|
||||
trials_data = []
|
||||
for trial in study.trials:
|
||||
|
|
|
@ -12,6 +12,8 @@ eNose = eNoseTrainer(eNoseLoader, test_size=0.2, debug=False)
|
|||
|
||||
eNoseLoader.target_list=['H2',]
|
||||
eNose.fit()
|
||||
eNoseLoader.target_list=['H2', 'C2H2', 'CH4', 'C2H4', 'C2H6',]
|
||||
eNose.fit()
|
||||
eNoseLoader.target_list=['C2H2',]
|
||||
eNose.fit()
|
||||
eNoseLoader.target_list=['CH4',]
|
||||
|
@ -20,8 +22,6 @@ eNoseLoader.target_list=['C2H4',]
|
|||
eNose.fit()
|
||||
eNoseLoader.target_list=['C2H6',]
|
||||
eNose.fit()
|
||||
eNoseLoader.target_list=['H2', 'C2H2', 'CH4', 'C2H4', 'C2H6',]
|
||||
eNose.fit()
|
||||
eNose.wrap_and_save()
|
||||
|
||||
# eNoseLoader.target_list=['H2',]
|
||||
|
|
Loading…
Reference in New Issue