本文整理汇总了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!")