Hi, There! Thanks for your great job! It help my research in GAN. But I confront a problem when I try to visualization the convolution layer in the discriminator. Actually, I found this when I try to apply the example code in my discriminator
My discriminator structure is this:
`
inputs = Input(shape=(32, 32, 3))
x = GaussianNoise(0.03)(inputs)
x = Conv2D(16, 3, border_mode='same', strides=(2, 2), init='glorot_normal')(x)
x = LeakyReLU(alpha=0.2)(x)
x = Dropout(0.5)(x)
x = Conv2D(32, 3, border_mode='same', init='glorot_normal', strides=(1, 1))(x)
x = BatchNormalization()(x)
x = LeakyReLU(alpha=0.2)(x)
x = Dropout(0.5)(x)
x = Conv2D(64, 3, border_mode='same', init='glorot_normal', strides=(2, 2))(x)
x = BatchNormalization()(x)
x = LeakyReLU(alpha=0.2)(x)
x = Dropout(0.5)(x)
x = Conv2D(128, 3, border_mode='same', init='glorot_normal', strides=(1, 1))(x)
x = BatchNormalization()(x)
x = LeakyReLU(alpha=0.2)(x)
x = Dropout(0.5)(x)
x = Conv2D(256, 3, border_mode='same', init='glorot_normal', strides=(2, 2))(x)
x = BatchNormalization()(x)
x = Activation('relu')(x)
x = Dropout(0.5)(x)
x = Conv2D(512, 3, border_mode='same', init='glorot_normal', strides=(1, 1))(x)
x = BatchNormalization()(x)
x = LeakyReLU(alpha=0.2)(x)
x = Dropout(0.5)(x)
x = Flatten()(x)
x = Dense(10, activation='softmax', name='predictions')(x)
model = Model(inputs, x)
`
Then I use the code in the example:
`
layer_idx = find_layer_idx(model, 'predictions')
model.layers[layer_idx].activation = activations.linear
model = apply_modifications(model)
img = visualize_activation(model, layer_idx, filter_indices=[0])
`
Unluckily, I got:
`
Traceback (most recent call last):
File "F:/keras-master/examples/CN!.py", line 51, in
model = apply_modifications(model)
File "H:\Anaconda3\lib\site-packages\vis\utils\utils.py", line 124, in apply_modifications
return load_model(model_path)
File "H:\Anaconda3\lib\site-packages\keras\models.py", line 246, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "H:\Anaconda3\lib\site-packages\keras\models.py", line 314, in model_from_config
Hi, There! Thanks for your great job! It help my research in GAN. But I confront a problem when I try to visualization the convolution layer in the discriminator. Actually, I found this when I try to apply the example code in my discriminator
My discriminator structure is this:
`
`
Then I use the code in the example: ` layer_idx = find_layer_idx(model, 'predictions') model.layers[layer_idx].activation = activations.linear model = apply_modifications(model) img = visualize_activation(model, layer_idx, filter_indices=[0])
`
Unluckily, I got: `
`
Everything will be fine when I remove all the LeakyReLU layer. Maybe, all the advance activation will mess up, I hope you could notice that!
Again , Thanks for your great job!!