def create_model():
sub_image = keras.layers.Input(shape=INPUT_SHAPE, name="image")
c2d=keras.layers.Conv2D(1, (CONV_SIZE, CONV_SIZE), strides=(2, 2), use_bias=False, name="C2D")(sub_image)
output = keras.layers.Dense(1, name="action",use_bias=False,trainable=False)(c2d)
model = keras.models.Model(inputs=sub_image, outputs=output, name=model_name)
return model
Model: "SingleC2D"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
image (InputLayer) [(None, 3, 3, 1)] 0
_________________________________________________________________
C2D (Conv2D) (None, 1, 1, 1) 9
_________________________________________________________________
action (Dense) (None, 1, 1, 1) 1
=================================================================
Total params: 10
Trainable params: 9
Non-trainable params: 1
out = model(inputs).numpy()[0][0][0][0]
print(out)
Hi,
Thanks for your reply.
> Did you try this without the Dense layer ?
I didn't, though it is set as trainable=False.
Is the output of conv2d a single value, in this case?
--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/3909fc17-3445-492f-835a-5ce63f181eeco%40tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to dis...@tensorflow.org.
Ah, yes, that does it, thanks!
I guess I was assuming that as the dense layer was non-trainable that there wouldn't be a weight (or would be 1).
I'll try by making the adjustment, or remove the dense layer as Sambath suggests.
Then I'll try training, as I am assuming the weights will then adjust to the image contents.