Python config.D Examples

The following are 4 code examples of config.D(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module config , or try the search function .
Example #1
Source File: train.py    From Keras-progressive_growing_of_gans with MIT License 5 votes vote down vote up
def load_GD(path, compile = False):
    G_path = os.path.join(path,'Generator.h5')
    D_path = os.path.join(path,'Discriminator.h5')
    G = load_model(G_path, compile = compile)
    D = load_model(D_path, compile = compile)
    return G,D 
Example #2
Source File: train.py    From Keras-progressive_growing_of_gans with MIT License 5 votes vote down vote up
def save_GD(G,D,path,overwrite = False):

        os.makedirs(path);
        G_path = os.path.join(path,'Generator.h5')
        D_path = os.path.join(path,'Discriminator.h5')
        save_model(G,G_path,overwrite = overwrite)
        save_model(D,D_path,overwrite = overwrite)
        print("Save model to %s"%path) 
Example #3
Source File: train.py    From Keras-progressive_growing_of_gans with MIT License 5 votes vote down vote up
def load_GD_weights(G,D,path, by_name = True):
    G_path = os.path.join(path,'Generator.h5')
    D_path = os.path.join(path,'Discriminator.h5')
    G.load_weights(G_path, by_name = by_name)
    D.load_weights(D_path, by_name = by_name)
    return G,D 
Example #4
Source File: train.py    From Keras-progressive_growing_of_gans with MIT License 5 votes vote down vote up
def save_GD_weights(G,D,path):
    try:
        os.makedirs(path);
        G_path = os.path.join(path,'Generator.h5')
        D_path = os.path.join(path,'Discriminator.h5')
        G.save_weights(G_path)
        D.save_weights(D_path)
        print("Save weights to %s:"%path)
    except:
        print("Save model snapshot failed!")