Exemple #1
0
def run_test(cfile):
    """
    Runs a configuration file
    """
    config = load_config_file(f"../TestConfigs/{cfile}.json", id=True)
    # print(config)
    dispatch = TrainDispatch()
    runconfig = RunConfig(impl=1,
                          verbose=True,
                          tboard=False,
                          best=True,
                          early=True,
                          multi=1,
                          proxy=False,
                          save=False,
                          remote=False,
                          info=True,
                          log=False)
    train_process, architecture = dispatch.dispatch(config['arch']['mode'])

    lresults = train_process(architecture, config, runconfig)
    print(lresults)
Exemple #2
0
:Description: Test

    

:Authors: bejar
    

:Version: 

:Created on: 09/11/2018 11:52 

"""

from Wind.Architectures.RNNS2SArchitecture import RNNS2SArchitecture
from Wind.Misc import load_config_file
from Wind.Train import RunConfig

__author__ = 'bejar'

if __name__ == '__main__':
    config = load_config_file("../examples/config_RNN_ED_s2s.json", id=True)
    config['idimensions'] = (12, 6)
    config['odimensions'] = 12
    runconfig = RunConfig(1, 0, False, False, False, False, False, False,
                          False)

    print(config)
    net = RNNS2SArchitecture(config, runconfig)
    net.generate_model()
    net.summary()
Exemple #3
0
        os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
        # The GPU id to use
        os.environ["CUDA_VISIBLE_DEVICES"] = args.dev

    verbose = 1 if args.verbose else 0
    impl = 2 if args.gpu else 1

    if args.config is None:
        config = getconfig(proxy=args.proxy, mode=args.exp, secpat=args.secpat)
    elif args.mino:
        config = load_config_file(args.config, id=False, mino=True)
    else:
        config = load_config_file(args.config, id=True)

    run_config = RunConfig(impl, verbose, args.tboard, args.best, args.early,
                           args.multi, args.proxy, args.save, args.remote,
                           args.info, args.log)

    dispatch = TrainDispatch()

    if config is not None:

        ############################################
        # Data

        if not 'site' in config:
            site = config['data']['datanames'][0].split('-')
            config['site'] = f"{site[0]}-{site[1]}"
        # try:
        print(
            f"Running job {config['_id']} {config['site']} {config['arch']['mode']} {strftime('%Y-%m-%d %H:%M:%S')}"