Esempio n. 1
0
def construct_model(data_init, model_type, margs, load_model_path,
                    load_model_complete, n_batch):
    import models
    margs['data_init'] = data_init
    if model_type == 'fcvae1':
        model = models.fcvae(**margs)
    if model_type == 'cvae1':
        model = models.cvae1(**margs)

    if load_model_path != None:
        print 'Loading existing model at ' + load_model_path
        _w = G.ndict.np_loadz(load_model_path + '/weights.ndict.tar.gz')
        G.ndict.set_value(model.w, _w, load_model_complete)
        G.ndict.set_value(model.w_avg, _w, load_model_complete)

    return model
Esempio n. 2
0
File: train.py Progetto: gburt/iaf
def construct_model(data_init, model_type, margs, load_model_path, load_model_complete, n_batch):
    import models

    margs["data_init"] = data_init
    if model_type == "fcvae1":
        model = models.fcvae(**margs)
    if model_type == "cvae1":
        model = models.cvae1(**margs)

    if load_model_path != None:
        print "Loading existing model at " + load_model_path
        _w = G.ndict.np_loadz(load_model_path + "/weights.ndict.tar.gz")
        G.ndict.set_value(model.w, _w, load_model_complete)
        G.ndict.set_value(model.w_avg, _w, load_model_complete)

    return model
Esempio n. 3
0
File: train.py Progetto: openai/iaf
def construct_model(data_init, model_type, margs, load_model_path, load_model_complete, n_batch):
    import models
    margs['data_init'] = data_init
    if model_type == 'fcvae1':
        model = models.fcvae(**margs)
    if model_type == 'cvae1':
        model = models.cvae1(**margs)
    if model_type == 'simplecvae1':
        import simplemodel
        model = simplemodel.simplecvae1(**margs)
    
    if load_model_path != None:
        print 'Loading existing model at '+load_model_path
        _w = G.ndict.np_loadz(load_model_path+'/weights.ndict.tar.gz')
                
        G.ndict.set_value(model.w, _w, load_model_complete)
        G.ndict.set_value(model.w_avg, _w, load_model_complete)
    
    return model