def visualize_weights(self, layer, imsize, layout):
"""
Displays the weights of a specified layer as images.
:param layer: the layer whose weights to display
:param imsize: the image size
:param layout: number of rows and columns for each page
:return: none
"""
if layer < self.net.n_layers:
self.net.visualize_weights(layer, imsize, layout)
elif layer == self.net.n_layers:
helper.disp_imdata(np.concatenate([W.get_value() for W in [self.Wa] + self.Wms + self.WUs], axis=1).T, imsize, layout)
plt.show(block=False)
else:
raise ValueError('Layer {} doesn\'t exist.'.format(layer))
评论列表
文章目录