예제 #1
0
파일: fabfile.py 프로젝트: yamins81/eccv12
def lfw_view2_random_AdaboostMixture(host, dbname, A):
    trials = MongoTrials(
            'mongo://%s:44556/%s/jobs' % (host, dbname),
            exp_key=exp_keys['random'],
            refresh=True)
    bandit = MultiBandit()
    mix = AdaboostMixture(trials, bandit, test_mask=True)
    # XXX: Should the weights be used? I don't think so, we're basically
    #      doing LPBoost at this point
    specs, weights, tids = mix.mix_models(int(A), ret_tids=True)
    assert len(specs) == len(tids)
    namebases = []
    for spec, tid in zip(specs, tids):
        # -- allow this feature cache to be
        #    reused by AdaboostMixture and
        #    SimpleMixtures of different 
        #    sizes

        #XXX: Potentially affected by the tid/injected jobs bug,
        #     but unlikely. Rerun just in case once dual svm solver is in.
        namebase = '%s_%s' % (dbname, tid)
        namebases.append(namebase)

        get_view2_features(
                slm_desc=spec['model']['slm'],
                preproc=spec['model']['preproc'],
                comparison=spec['comparison'],
                namebase=namebase,
                basedir=os.getcwd(),
                )

    basedirs = [os.getcwd()] * len(namebases)

    train_view2(namebases=namebases, basedirs=basedirs)
예제 #2
0
파일: fabfile.py 프로젝트: yamins81/eccv12
def lfw_view2_final_get_mix(host='honeybadger.rowland.org',
                            dbname='final_random',
                            A=100):
    trials = MongoTrials(
            'mongo://%s:44556/%s/jobs' % (host, dbname),
            exp_key=exp_keys['random'],
            refresh=True)
    return trials
    bandit = MultiBandit()
    simple_mix = SimpleMixture(trials, bandit)
    simple_mix_trials =  simple_mix.mix_trials(int(A))
    ada_mix = AdaboostMixture(trials, bandit)
    ada_mix_trials =  ada_mix.mix_trials(int(A))    
    
    return simple_mix_trials, ada_mix_trials