Ejemplo n.º 1
0
def nnet1_template(dataset_name='skdata.larochelle_etal_2007.Rectangles',
            sup_min_epochs=30, # THESE ARE KINDA SMALL FOR SERIOUS RESULTS
            sup_max_epochs=400):
    template = rSON2(
        'preprocessing', one_of(
            rSON2(
                'kind', 'raw'),
            rSON2(
                'kind', 'zca',
                'energy', uniform(0.5, 1.0))),
        'dataset_name', dataset_name,
        'sup_max_epochs', sup_max_epochs,
        'sup_min_epochs', sup_min_epochs,
        'iseed', one_of(5, 6, 7, 8),
        'batchsize', one_of(20, 100),
        'lr', lognormal(numpy.log(.01), 3),
        'lr_anneal_start', geom(100, 10000),
        'l2_penalty', one_of(0, lognormal(numpy.log(1.0e-6), 3)),
        'next_layer', rSON2(
            'n_hid', geom(2**4, 2**10, round=16),
            'W_init_dist', one_of('uniform', 'normal'),
            'W_init_algo', one_of('old', 'Xavier'),
            'W_init_algo_old_multiplier', uniform(.2, 2),
            'cd_epochs', 0,
            'cd_batchsize', 100,
            'cd_sample_v0s', one_of(False, True),
            'cd_lr', lognormal(numpy.log(.01), 3),
            'cd_lr_anneal_start', geom(10, 10000),
            'next_layer', None))
    return template
Ejemplo n.º 2
0
 def __init__(self):
     Base.__init__(self, rSON2(
         'x', uniform(-20, 20),
         'hf', one_of(
             rSON2(
                 'kind', 'raw'),
             rSON2(
                 'kind', 'negcos',
                 'amp', uniform(0, 1)))))
def dbn_template(dataset_name='skdata.larochelle_etal_2007.Rectangles',
                 sup_min_epochs=300,
                 sup_max_epochs=4000):
    template = rSON2(
        'preprocessing',
        one_of(rSON2('kind', 'raw'),
               rSON2('kind', 'zca', 'energy', uniform(0.5, 1.0))),
        'dataset_name', dataset_name, 'sup_max_epochs',
        sup_max_epochs, 'sup_min_epochs', sup_min_epochs, 'iseed',
        one_of(5, 6, 7, 8), 'batchsize', one_of(20, 100), 'lr',
        lognormal(numpy.log(.01),
                  3), 'lr_anneal_start', geom(100, 10000), 'l2_penalty',
        one_of(0, lognormal(numpy.log(1.0e-6), 2)), 'next_layer',
        one_of(
            None,
            rSON2(
                'n_hid', geom(2**7, 2**12, round=16), 'W_init_dist',
                one_of('uniform', 'normal'), 'W_init_algo',
                one_of('old', 'Xavier'), 'W_init_algo_old_multiplier',
                lognormal(0.0, 1.0), 'cd_epochs', geom(1, 3000),
                'cd_batchsize', 100, 'cd_sample_v0s', one_of(False,
                                                             True), 'cd_lr',
                lognormal(numpy.log(.01), 2), 'cd_lr_anneal_start',
                geom(10, 10000), 'next_layer',
                one_of(
                    None,
                    rSON2(
                        'n_hid', geom(2**7, 2**12, round=16), 'W_init_dist',
                        one_of('uniform', 'normal'), 'W_init_algo',
                        one_of('old', 'Xavier'), 'W_init_algo_old_multiplier',
                        lognormal(0.0, 1.0), 'cd_epochs', geom(1, 2000),
                        'cd_batchsize', 100, 'cd_sample_v0s',
                        one_of(False, True), 'cd_lr',
                        lognormal(numpy.log(.01), 2), 'cd_lr_anneal_start',
                        geom(10, 10000), 'next_layer',
                        one_of(
                            None,
                            rSON2(
                                'n_hid',
                                geom(2**7, 2**12, round=16),
                                'W_init_dist',
                                one_of('uniform', 'normal'),
                                'W_init_algo',
                                one_of('old', 'Xavier'),
                                'W_init_algo_old_multiplier',
                                lognormal(0., 1.),
                                'cd_epochs',
                                geom(1, 1500),
                                'cd_batchsize',
                                100,
                                'cd_sample_v0s',
                                one_of(False, True),
                                'cd_lr',
                                lognormal(numpy.log(.01), 2),
                                'cd_lr_anneal_start',
                                geom(10, 10000),
                                'next_layer',
                                None,
                            )))))))
    return template
Ejemplo n.º 4
0
 def __init__(self, sigma=10):
     """
     The second peak is at x=-10.
     The prior mean is 0.
     """
     Base.__init__(self, rSON2('x', normal(0, sigma)))
Ejemplo n.º 5
0
 def __init__(self):
     Base.__init__(self, rSON2('x', one_of(0, 1)))
Ejemplo n.º 6
0
 def __init__(self):
     Base.__init__(self, rSON2('x', lognormal(0, 2)))
Ejemplo n.º 7
0
 def __init__(self):
     Base.__init__(self, rSON2('x', uniform(-5, 5)))
Ejemplo n.º 8
0
 def __init__(self):
     Base.__init__(self, rSON2(
         'curve', one_of(0, 1),
         'x', uniform(-20, 20)))