本文整理匯總了Python中config.D屬性的典型用法代碼示例。如果您正苦於以下問題:Python config.D屬性的具體用法?Python config.D怎麽用?Python config.D使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類config
的用法示例。
在下文中一共展示了config.D屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: load_GD
# 需要導入模塊: import config [as 別名]
# 或者: from config import D [as 別名]
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
示例2: save_GD
# 需要導入模塊: import config [as 別名]
# 或者: from config import D [as 別名]
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)
示例3: load_GD_weights
# 需要導入模塊: import config [as 別名]
# 或者: from config import D [as 別名]
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
示例4: save_GD_weights
# 需要導入模塊: import config [as 別名]
# 或者: from config import D [as 別名]
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!")