@author: brummli """ import baseParser import config_ from experiment import AutoencoderGWRExperiment import nn_main import gwr_main def addExtraGWRArguments(parser): parser.add_argument("-gle", "--GWR_lengthExample", type=baseParser.check_positive, help='The number of frames to use', default=1) #TODO: change default parser.add_argument("-ghe", "--GWR_hopExample", type=baseParser.check_positive, help='The number of frames to advance per example', default=1) #TODO: change default parser.add_argument("-gmo", "--GWR_NNModelName", type=str, help='Specifies the feature extraction neural net by its file name', default=None) parser.add_argument("-el", "--extractionLayer", type=baseParser.check_positive_zero, help='Which layers output of the autoencoder will be used to extract a transformed representation', default=config_.extractionLayer) parser.set_defaults(modelType='GWR') return parser if __name__ == '__main__': parser = baseParser.createBaseParser() nnParser = nn_main.addNNArguments(parser) gwrParser = gwr_main.addGWRArguments(nnParser) combinedParser = addExtraGWRArguments(gwrParser) fullParser = baseParser.addModeParsers(combinedParser) args = fullParser.parse_args() exp = AutoencoderGWRExperiment(args) args.func(args,exp)
type=float, help='Bla', default=config_.epsilonB) GWRGroup.add_argument("-en", "--epsilonN", type=float, help='Bla', default=config_.epsilonN) GWRGroup.add_argument("-tb", "--tauB", type=float, help="tau B", default=config_.tauB) GWRGroup.add_argument("-tn", "--tauN", type=float, help="tau N", default=config_.tauN) parser.set_defaults(modelType='GWR') return parser if __name__ == '__main__': parser = baseParser.createBaseParser() gwrParser = addGWRArguments(parser) fullParser = baseParser.addModeParsers(gwrParser) args = fullParser.parse_args() exp = GWRExperiment(args) args.func(args, exp)
# -*- coding: utf-8 -*- """ Created on Mon Feb 19 13:21:06 2018 @author: brummli """ import baseParser import config_ from experiment import KMeansExperiment def addKMeansArguments(parser): KMeansGroup = parser.add_argument_group('KMeans', 'K-Means specific values') KMeansGroup.add_argument("-ncl", "--numCluster", type=baseParser.check_positive, help='Number of cluster for K-Means', default=config_.numCluster) KMeansGroup.add_argument("-pc", "--patience", type=baseParser.check_positive_zero, help='Number of iterations without improvement before stopping training', default=config_.patience) KMeansGroup.add_argument("-re", "--reassignment", type=float, help='Fraction when to reassign cluster centers', default=config_.reassignment) #TODO:description KMeansGroup.add_argument("-tol", "--tolerance", type=float, help='Improvement within tolerance is accepted as converged', default=config_.KMeans_tolerance) #KMeansGroup.add_argument("-b", "--batch_size", type=check_positive, help='The batch size used during training', default=config_.KMeans_batch_size) TODO: when we use separate files or parsers per algorithm parser.set_defaults(modelType='KMeans') return parser if __name__ == '__main__': parser = baseParser.createBaseParser() kmeansParser = addKMeansArguments(parser) fullParser = baseParser.addModeParsers(kmeansParser) args = fullParser.parse_args() exp = KMeansExperiment(args) args.func(args,exp)
# -*- coding: utf-8 -*- """ Created on Mon Feb 19 13:21:06 2018 @author: brummli """ import baseParser import config_ from experiment import NNExperiment def addNNArguments(parser): nnGroup = parser.add_argument_group('NN', 'Neural Net specific values') nnGroup.add_argument("-l", "--layers", type=baseParser.check_positive_zero, help='Number of layers in the neural net model', default=config_.layers) nnGroup.add_argument("-hid", "--hiddenNodes", type=baseParser.check_positive, help='Number of hidden Units in each layer', default=config_.hiddenNodes) nnGroup.add_argument("-lr", "--learningRate", type=float, help='Initial learning rate', default=config_.lr) nnGroup.add_argument("-s", "--sigma", type=float, help='Width of gaussian noise added for denoising autoencoder', default=config_.sigma) parser.add_argument("modelType", help='defines the model type',choices=['RNN_AE','LSTM','FF','FF_AE','SEQ_AE','SEQ']) return parser if __name__ == '__main__': parser = baseParser.createBaseParser() nnParser = addNNArguments(parser) fullParser = baseParser.addModeParsers(nnParser) args = fullParser.parse_args() exp = NNExperiment(args) args.func(args,exp)