Esempio n. 1
0
def main():
    if params.gpu_flag is not False:
        cuda.init(params.gpu_flag)
    print 'fetching data ...'
    fetcher = cifar(norm=False)

    bo = BO(
        train_model, {
            'wscale1': (-5, 0),
            'wscale2': (-5, 0),
            'wscale3': (-5, 0),
            'wscale4': (-5, 0),
            'wscale5': (-5, 0),
            'lr': (-4, -2),
            'batchsize': (30, 300),
            'momentum': (0.5, 1.0),
            'decay': (-4, -2)
        })
    """
    bo.explore({'wscale1'   : [-4],
                'wscale2'   : [-2],
                'wscale3'   : [-2],
                'wscale4'   : [-1],
                'wscale5'   : [-1],
                'lr'        : [-3],
                'batchsize' : [100],
                'momentum'  : [0.9],
                'decay'     : [-3]
                })
    """

    bo.add_f_args('fetcher', fetcher)
    bo.maximize(init_points=params.opt_init_points, n_iter=params.opt_iter)
    print bo.res['max']
def main():
    if params.gpu_flag is not False:
        cuda.init(params.gpu_flag)
    print 'fetching data ...'
    fetcher = cifar(norm=False)

    bo = BO(train_model,
            {'wscale1'   : (-5, 0),
             'wscale2'   : (-5, 0),
             'wscale3'   : (-5, 0),
             'wscale4'   : (-5, 0),
             'wscale5'   : (-5, 0),
             'lr'        : (-4, -2),
             'batchsize' : (30, 300),
             'momentum'  : (0.5, 1.0),
             'decay'     : (-4, -2)
            })

    """
    bo.explore({'wscale1'   : [-4],
                'wscale2'   : [-2],
                'wscale3'   : [-2],
                'wscale4'   : [-1],
                'wscale5'   : [-1],
                'lr'        : [-3],
                'batchsize' : [100],
                'momentum'  : [0.9],
                'decay'     : [-3]
                })
    """

    bo.add_f_args('fetcher', fetcher)
    bo.maximize(init_points=params.opt_init_points, n_iter=params.opt_iter)
    print bo.res['max']
def main():
    if params.gpu_flag is not False:
        cuda.init(params.gpu_flag)
    if params.model_name is False:
        model = init_model()
    else:
        model = load_model(params.model_name)
    optimizer = init_optimizer(model)
    print 'fetching data ...'
    fetcher = cifar(norm=False)
    print 'done'
    train_and_val(model, optimizer, fetcher)
def main():
    if params.gpu_flag is not False:
        cuda.init(params.gpu_flag)
    if params.model_name is False:
        model = init_model()
    else:
        model = load_model(params.model_name)
    optimizer = init_optimizer(model)
    print 'fetching data ...'
    fetcher = cifar(norm=False)
    print 'done'
    train_and_val(model, optimizer, fetcher)