def plot_filters(self):
		filter_start = 0 # First filter to show
		layer_names = [l['name'] for l in self.layers]
		if self.show_filters not in layer_names:
			raise ShowNetError(self.show_filters % "Layer with name '%s' not defined by given convnet.")
		layer = self.layers[layer_names.index(self.show_filters)]
		filters = layer['weights'][self.input_idx]
		if layer['type'] == 'fc': # Fully-connected layer
			num_filters = layer['outputs']
			channels = self.channels
		elif layer['type'] in ('conv', 'local'): # Conv layer
			num_filters = layer['filters']
			channels = layer['filterChannels'][self.input_idx]
			if layer['type'] == 'local':
				filters = filters.reshape((layer['modules'], layer['filterPixels'][self.input_idx] * channels, num_filters))
				filter_start = r.randint(0, layer['modules']-1)*num_filters # pick out some random modules
				filters = filters.swapaxes(0,1).reshape(channels * layer['filterPixels'][self.input_idx], num_filters * layer['modules'])
				num_filters *= layer['modules']

		filters = filters.reshape(channels, filters.shape[0]/channels, filters.shape[1])
		# Convert YUV filters to RGB
		if self.yuv_to_rgb and channels == 3:
			R = filters[0,:,:] + 1.28033 * filters[2,:,:]
			G = filters[0,:,:] + -0.21482 * filters[1,:,:] + -0.38059 * filters[2,:,:]
			B = filters[0,:,:] + 2.12798 * filters[1,:,:]
			filters[0,:,:], filters[1,:,:], filters[2,:,:] = R, G, B
		combine_chans = not self.no_rgb and channels == 3
		
		# Make sure you don't modify the backing array itself here -- so no -= or /=
		filters = filters - filters.min()
		filters = filters / filters.max()

		self.make_filter_fig(filters, filter_start, 2, 'Layer %s' % self.show_filters, num_filters, combine_chans)
dataset/ETHPy150Open zygmuntz/kaggle-cifar/shownet.py/ShowConvNet.plot_filters/swapped operands of `%`