Exemple #1
0
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():
    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()
Exemple #3
0
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()
Exemple #4
0
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():
#    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()