def define_network(self, l2_reg):
print("Setting up network...")
if (self.network_type == 'encdec'):
self.model = nn_model.encdec(self.nx, self.ny, self.noise, self.depth, activation=self.activation)
if (self.network_type == 'keepsize'):
self.model = nn_model.keepsize(self.nx, self.ny, self.noise, self.depth, activation=self.activation)
json_string = self.model.to_json()
f = open('{0}_{1}_model.json'.format(self.root, self.depth), 'w')
f.write(json_string)
f.close()
with open('{0}_{1}_summary.txt'.format(self.root, self.depth), 'w') as f:
with redirect_stdout(f):
self.model.summary()
plot_model(self.model, to_file='{0}_{1}_model.png'.format(self.root, self.depth), show_shapes=True)
评论列表
文章目录