当前位置: 首页>>代码示例>>Python>>正文


Python experiment.init_experiment函数代码示例

本文整理汇总了Python中neuralnilm.experiment.init_experiment函数的典型用法代码示例。如果您正苦于以下问题:Python init_experiment函数的具体用法?Python init_experiment怎么用?Python init_experiment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了init_experiment函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

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()
开发者ID:mmottahedi,项目名称:neuralnilm_prototype,代码行数:32,代码来源:e498.py

示例2: main

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()
开发者ID:mmottahedi,项目名称:neuralnilm_prototype,代码行数:32,代码来源:e491.py

示例3: main

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")
开发者ID:mmottahedi,项目名称:neuralnilm_prototype,代码行数:15,代码来源:e277.py

示例4: main

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()
开发者ID:mmottahedi,项目名称:neuralnilm_prototype,代码行数:17,代码来源:e554.py

示例5: main

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()
开发者ID:mmottahedi,项目名称:neuralnilm_prototype,代码行数:20,代码来源:e426.py


注:本文中的neuralnilm.experiment.init_experiment函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。