def main(): APPLIANCES = [ ('a', ['fridge freezer', 'fridge'], 512), ('b', "'coffee maker'", 512), ('c', "'dish washer'", 2000), ('d', "'hair dryer'", 256), ('e', "'kettle'", 256), ('f', "'oven'", 2000), ('g', "'toaster'", 256), ('h', "'light'", 2000), ('i', ['washer dryer', 'washing machine'], 1504) ] for experiment, appliance, seq_length in APPLIANCES[-1:]: full_exp_name = NAME + experiment func_call = init_experiment(PATH, 'a', full_exp_name) func_call = func_call[:-1] + ", {}, {})".format(appliance, seq_length) logger = logging.getLogger(full_exp_name) try: net = eval(func_call) run_experiment(net, epochs=5000) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception as exception: logger.exception("Exception") # raise else: del net.source del net gc.collect() finally: logging.shutdown()
def main(): APPLIANCES = [ ("a", ["fridge freezer", "fridge"], 512), ("b", "'coffee maker'", 512), ("c", "'dish washer'", 2000), ("d", "'hair dryer'", 256), ("e", "'kettle'", 256), ("f", "'oven'", 2000), ("g", "'toaster'", 256), ("h", "'light'", 2000), ("i", ["washer dryer", "washing machine"], 1504), ] for experiment, appliance, seq_length in APPLIANCES[-1:]: full_exp_name = NAME + experiment func_call = init_experiment(PATH, "a", full_exp_name) func_call = func_call[:-1] + ", {}, {})".format(appliance, seq_length) logger = logging.getLogger(full_exp_name) try: net = eval(func_call) run_experiment(net, epochs=None) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception as exception: logger.exception("Exception") # raise else: del net.source del net gc.collect() finally: logging.shutdown()
def main(): # for net_dict_func in [net_dict_ae, net_dict_rectangles, net_dict_rnn]: for net_dict_func in [net_dict_ae, net_dict_rectangles]: for appliance in ['microwave', 'kettle', 'dish washer']: full_exp_name = NAME + '_' + appliance + '_' + net_dict_func.name change_dir(PATH, full_exp_name) configure_logger(full_exp_name) logger = logging.getLogger(full_exp_name) global multi_source multi_source = get_source( appliance, logger, target_is_start_and_end_and_mean=(net_dict_func == net_dict_rectangles), is_rnn=(net_dict_func == net_dict_rnn) ) seq_length = multi_source.sources[0]['source'].seq_length net_dict = net_dict_func(seq_length) epochs = net_dict.pop('epochs') try: net = exp_a(full_exp_name, net_dict, multi_source) run_experiment(net, epochs=epochs) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception: logger.exception("Exception") # raise finally: logging.shutdown()
def main(): for net_dict_func in [net_dict_ae_rnn]: for appliance in ['microwave']: full_exp_name = NAME + '_' + appliance + '_' + net_dict_func.name change_dir(PATH, full_exp_name) configure_logger(full_exp_name) logger = logging.getLogger(full_exp_name) global multi_source multi_source = get_source( appliance, logger, is_rnn=True ) seq_length = multi_source.sources[0]['source'].seq_length net_dict = net_dict_func(seq_length) epochs = net_dict.pop('epochs') try: net = exp_a(full_exp_name, net_dict, multi_source) net.experiment_name = 'e567_microwave_ae' net.set_csv_filenames() net.load_params(iteration=100000, path='/data/dk3810/figures/e567_microwave_ae') net.experiment_name = full_exp_name net.set_csv_filenames() run_experiment(net, epochs=epochs) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception: logger.exception("Exception") # raise finally: logging.shutdown()
def main(): global logger EXPERIMENTS = list('abcdefghijklmnopqrstu') for experiment in EXPERIMENTS: full_exp_name = NAME + experiment path = os.path.join(PATH, full_exp_name) try: os.mkdir(path) except OSError as exception: if exception.errno == 17: print(path, "already exists. Reusing directory.") else: raise os.chdir(path) try: net = init_experiment(experiment) run_experiment(net, path, epochs=500) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except TrainingError as exception: logger.exception() except Exception as exception: logger.exception()
def main(): for experiment in list('a'): full_exp_name = NAME + experiment path = os.path.join(PATH, full_exp_name) try: net = init_experiment(experiment) run_experiment(net, path, epochs=5000) except KeyboardInterrupt: break except TrainingError as e: print("EXCEPTION:", e)
def main(): for experiment in list('a'): full_exp_name = NAME + experiment path = os.path.join(PATH, full_exp_name) try: net = init_experiment(experiment) run_experiment(net, path, epochs=None) except KeyboardInterrupt: break except TrainingError as exception: print("EXCEPTION:", exception) except Exception as exception: print("EXCEPTION:", exception) import ipdb; ipdb.set_trace()
def main(): experiment = "a" full_exp_name = NAME + experiment path = os.path.join(PATH, full_exp_name) print("***********************************") print("Preparing", full_exp_name, "...") try: net = exp_x(full_exp_name) run_experiment(net, path, epochs=5000) except KeyboardInterrupt: return except TrainingError as exception: print("EXCEPTION:", exception) except Exception as exception: print("EXCEPTION:", exception)
def main(): # EXPERIMENTS = list('abcdefghijklmnopqrstuvwxyz') EXPERIMENTS = list('z') for experiment in EXPERIMENTS: full_exp_name = NAME + experiment func_call = init_experiment(PATH, experiment, full_exp_name) logger = logging.getLogger(full_exp_name) try: net = eval(func_call) run_experiment(net, epochs=None) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception as exception: logger.exception("Exception")
def main(): for experiment, learning_rate in [('a', 1.0), ('b', 0.1), ('c', 0.01), ('d', 0.001), ('e', 0.0001)]: full_exp_name = NAME + experiment path = os.path.join(PATH, full_exp_name) print("***********************************") print("Preparing", full_exp_name, "...") try: net = exp_x(full_exp_name, learning_rate) run_experiment(net, path, epochs=1000) except KeyboardInterrupt: break except TrainingError as exception: print("EXCEPTION:", exception) except Exception as exception: print("EXCEPTION:", exception)
def main(): # for net_dict_func in [net_dict_ae, net_dict_rectangles, net_dict_rnn]: for net_dict_func in [net_dict_rnn]: # for appliance in ['microwave', 'washing machine', # 'fridge', 'kettle', 'dish washer']: for appliance in ['washing machine', 'fridge', 'kettle', 'dish washer']: # REMOVE IF RUN FROM SCRATCH: if net_dict_func == net_dict_ae: if appliance in ['microwave', 'washing machine', 'dish washer']: continue elif net_dict_func == net_dict_rectangles: if appliance == 'microwave': continue full_exp_name = NAME + '_' + appliance + '_' + net_dict_func.name change_dir(PATH, full_exp_name) configure_logger(full_exp_name) logger = logging.getLogger(full_exp_name) global multi_source multi_source = get_source( appliance, logger, target_is_start_and_end_and_mean=(net_dict_func == net_dict_rectangles), is_rnn=(net_dict_func == net_dict_rnn) ) seq_length = multi_source.sources[0]['source'].seq_length net_dict = net_dict_func(seq_length) epochs = net_dict.pop('epochs') try: net = exp_a(full_exp_name, net_dict, multi_source) # REMOVE IF RUN FROM SCRATCH: if (appliance == 'washing machine' and net_dict_func == net_dict_rectangles): net.load_params(85351) if (appliance == 'washing machine' and net_dict_func == net_dict_rnn): net.load_params(4000) run_experiment(net, epochs=epochs) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception: logger.exception("Exception") # raise finally: logging.shutdown()
def main(): EXPERIMENTS = list('a') for experiment in EXPERIMENTS: full_exp_name = NAME + experiment func_call = init_experiment(PATH, experiment, full_exp_name) logger = logging.getLogger(full_exp_name) try: net = eval(func_call) run_experiment(net, epochs=None) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception: logger.exception("Exception") # raise finally: logging.shutdown()
def main(): # EXPERIMENTS = list('abcdefghijklmnopqrstuvwxyz') EXPERIMENTS = list('a') for experiment in EXPERIMENTS: full_exp_name = NAME + experiment func_call = init_experiment(PATH, experiment, full_exp_name) logger = logging.getLogger(full_exp_name) try: net = eval(func_call) run_experiment(net, epochs=None) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception as exception: logger.exception("Exception") # raise finally: logging.shutdown()
def main(): EXPERIMENTS = list('a') for experiment in EXPERIMENTS: full_exp_name = NAME + experiment func_call = init_experiment(PATH, experiment, full_exp_name) logger = logging.getLogger(full_exp_name) try: net = eval(func_call) run_experiment(net, epochs=None) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception as exception: logger.exception("Exception") # raise else: del net.source.train_activations gc.collect() finally: logging.shutdown()
def main(): EXPERIMENTS = list("a") for experiment in EXPERIMENTS: full_exp_name = NAME + experiment func_call = init_experiment(PATH, experiment, full_exp_name) logger = logging.getLogger(full_exp_name) try: net = eval(func_call) run_experiment(net, epochs=None) except KeyboardInterrupt: logger.info("KeyboardInterrupt") break except Exception as exception: logger.exception("Exception") # raise else: del net.source.train_activations gc.collect() finally: logging.shutdown()