def display_history(arguments, set_vars): """ Display history of current user on screen @param: arguments: history command's arguments @param: set_vars: dictionary of variables """ if not arguments: show_history(arguments, set_vars) set_vars['exit_status'] = 0 elif len(arguments) == 1 and arguments[0].isnumeric(): show_history(arguments, set_vars) set_vars['exit_status'] = 0 else: if not arguments[0].isnumeric(): print('intek-sh: history: ' + arguments[0] + ': numeric argument required') else: print('intek-sh: history: too many arguments') set_vars['exit_status'] = 1
def showRawValues(self): try: self._dl = fn.qt.QDialogWidget(buttons=True) qc = Qt.QComboBox() qc.addItems(sorted(self.last_args.keys())) self._dl.setWidget(qc) #dates = [] #try: #self.warning('-------------------') #dates.append(self.trend.axisScaleDiv(self.trend.xBottom).lowerBound()) #dates.append(self.trend.axisScaleDiv(self.trend.xBottom).upperBound()) #self.warning(dates) #except: self.warning(traceback.format_exc()) self._dl.setAccept(lambda q=qc:show_history(parseTrendModel(str(q.currentText()))[1])) #,dates=dates)) self._dl.show() except: self.warning(traceback.format_exc())
def showRawValues(self): try: self._dl = fn.qt.QDialogWidget(buttons=True) qc = Qt.QComboBox() qc.addItems(sorted(self.last_args.keys())) self._dl.setWidget(qc) #dates = [] #try: #self.warning('-------------------') #dates.append(self.trend.axisScaleDiv(self.trend.xBottom).lowerBound()) #dates.append(self.trend.axisScaleDiv(self.trend.xBottom).upperBound()) #self.warning(dates) #except: self.warning(traceback.format_exc()) self._dl.setAccept(lambda q=qc: show_history( parseTrendModel(str(q.currentText()))[1])) #,dates=dates)) self._dl.show() except: self.warning(traceback.format_exc())
epochs = 200 samples = 20000 size = 64 input_size = (size, size, 3) x_train, y_train = load_regulized_train_dataset(samples, size) y_train = to_categorical(y_train) x_train, x_validation, y_train, y_validation = train_test_split( x_train, y_train, test_size=0.2, stratify=y_train) model = cnn_model(input_size) callbacks = [ ModelCheckpoint(filepath="./models/model_{epoch:02d}.h5"), TensorBoard(log_dir="./logs") ] model_history = model.fit(x_train, y_train, epochs=epochs, callbacks=callbacks, validation_data=(x_validation, y_validation)) model.save("./models/model_final.h5") history = model_history.history with open("./history/model_history.pkl", "wb") as f: pickle.dump(history, f) show_history(history)