elif level == "ERROR": logger.setLevel(logging.ERROR) else: logger.setLevel(logging.WARNING) def runNet(modelConfig): nnetType = modelConfig["nnetType"] logger.info("Loading Other Configuration for %s", nnetType) if nnetType == "CNN": from pythonDnn.run.run_CNN import runCNN as runModel elif nnetType == "CNN3D": from pythonDnn.run.run_CNN3d import runCNN3D as runModel elif nnetType == "RBM": from pythonDnn.run.run_DBN import runRBM as runModel elif nnetType == "SDA": from pythonDnn.run.run_SDA import runSdA as runModel elif nnetType == "DNN": from pythonDnn.run.run_DNN import runDNN as runModel else: logger.error("Unknown nnet Type") return 1 runModel(modelConfig) if __name__ == "__main__": setLogger() modelConfig = load_model(sys.argv[1]) setLoggerLevel(modelConfig) runNet(modelConfig)
train_sets = read_dataset(data_spec['training']) preTraining(dbn, train_sets, model_config['pretrain_params']) del train_sets ######################## # FINETUNING THE MODEL # ######################## if model_config['processes']['finetuning']: fineTunning(dbn, model_config, data_spec) ######################## # TESTING THE MODEL # ######################## if model_config['processes']['testing']: testing(dbn, data_spec) ########################## # Export Features ## ########################## if model_config['processes']['export_data']: exportFeatures(dbn, model_config, data_spec) logger.info('Saving model to ' + str(model_config['output_file']) + '....') dbn.save(filename=model_config['output_file']) logger.info('Saved model to ' + str(model_config['output_file'])) if __name__ == '__main__': import sys setLogger() runRBM(sys.argv[1])
######################## # FINETUNING THE MODEL # ######################## if model_config['processes']['finetuning']: fineTunning(dnn,model_config,data_spec) ######################## # TESTING THE MODEL # ######################## if model_config['processes']['testing']: testing(dnn,data_spec) ########################## ## Export Features ## ########################## if model_config['processes']['export_data']: exportFeatures(dnn,model_config,data_spec) logger.info('Saving model to ' + str(model_config['output_file']) + '....') dnn.save(filename=model_config['output_file']) logger.info('Saved model to ' + str(model_config['output_file'])) if __name__ == '__main__': import sys setLogger(level="INFO"); logger.info('Stating....'); runDNN(sys.argv[1]); sys.exit(0)
train_sets = read_dataset(data_spec['training']) preTraining(dbn,train_sets,model_config['pretrain_params']) del train_sets; ######################## # FINETUNING THE MODEL # ######################## if model_config['processes']['finetuning']: fineTunning(dbn,model_config,data_spec) ######################## # TESTING THE MODEL # ######################## if model_config['processes']['testing']: testing(dbn,data_spec) ########################## # Export Features ## ########################## if model_config['processes']['export_data']: exportFeatures(dbn,model_config,data_spec) logger.info('Saving model to ' + str(model_config['output_file']) + '....') dbn.save(filename=model_config['output_file']) logger.info('Saved model to ' + str(model_config['output_file'])) if __name__ == '__main__': import sys setLogger(); runRBM(sys.argv[1])
elif level == "ERROR": logger.setLevel(logging.ERROR) else: logger.setLevel(logging.WARNING) def runNet(modelConfig): nnetType = modelConfig ['nnetType'] logger.info("Loading Other Configuration for %s",nnetType); if nnetType == 'CNN': from pythonDnn.run.run_CNN import runCNN as runModel elif nnetType == 'CNN3D': from pythonDnn.run.run_CNN3d import runCNN3D as runModel elif nnetType == 'RBM': from pythonDnn.run.run_DBN import runRBM as runModel elif nnetType == 'SDA': from pythonDnn.run.run_SDA import runSdA as runModel elif nnetType == 'DNN': from pythonDnn.run.run_DNN import runDNN as runModel else : logger.error('Unknown nnet Type') return 1 runModel(modelConfig) if __name__ == '__main__': setLogger(); modelConfig = load_model(sys.argv[1]) setLoggerLevel(modelConfig) runNet(modelConfig)