Skip to content

Commit fafe52b

Browse files
committed
update basic layer for printing params
1 parent a2abe19 commit fafe52b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tensorlayer/layers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,14 @@ def print_params(self, details=True):
275275
for i, p in enumerate(self.all_params):
276276
if details:
277277
try:
278-
print(" param {:3}: {:15} (mean: {:<18}, median: {:<18}, std: {:<18}) {}".format(i, str(p.eval().shape), p.eval().mean(), np.median(p.eval()), p.eval().std(), p.name))
278+
# print(" param {:3}: {:15} (mean: {:<18}, median: {:<18}, std: {:<18}) {}".format(i, str(p.eval().shape), p.eval().mean(), np.median(p.eval()), p.eval().std(), p.name))
279+
val = p.eval()
280+
print(" param {:3}: {:20} {:15} (mean: {:<18}, median: {:<18}, std: {:<18}) ".format(i, p.name, str(val.shape), val.mean(), np.median(val), val.std()))
279281
except Exception as e:
280282
print(str(e))
281283
raise Exception("Hint: print params details after tl.layers.initialize_global_variables(sess) or use network.print_params(False).")
282284
else:
283-
print(" param {:3}: {:15} {}".format(i, str(p.get_shape()), p.name))
285+
print(" param {:3}: {:20} {:15}".format(i, p.name, str(p.get_shape())))
284286
print(" num of params: %d" % self.count_params())
285287

286288
def print_layers(self):

0 commit comments

Comments
 (0)