I make a small keras model and get weights of model using following code:
from keras.models import Sequential
from keras.layers import Dense, Flatten,Conv2D, MaxPooling2D
input_shape = (28, 28, 1)
model = Sequential()
model.add(Conv2D(1, kernel_size=(2, 2),
activation='relu',
input_shape=input_shape,trainable=False))
model.add(MaxPooling2D(pool_size=(16,16)))
model.add(Flatten())
model.add(Dense(3, activation='softmax',trainable=False))
a=model.get_weights()
Now i want to initialize weights as same shape of a using keras initializers, i am using following code:
from keras.initializers import glorot_uniform
W1 = glorot_uniform((a,))
Is my approach is right? If it is wrong then please suggest me the solution and if it is right then why i am not able to see the weights, it's showing:
<keras.initializers.VarianceScaling at 0x7f65746ba128>