どんな画像データから何の結果を求めようとしているのかわからないので間違っているかもしれませんが、
下記で実現できると思います。
Denseはデフォルトではバイアスベクトルが含まれてしまうため、
modelの例ではパラメータ数が32+1になっています。
また、model_no_biasの例のようにuse_bias=Falseに設定することでbiasを含まないパラメータ数32にすることができます。
https://keras.io/ja/layers/core/#dense
python
1import keras
2from keras.models import Sequential
3from keras.layers import Dense
4
5model = Sequential()
6model.add(Dense(1, input_shape=(128,128,32)))
7model.summary()
8
9model_no_bias = Sequential()
10model_no_bias.add(Dense(1, use_bias=False, input_shape=(128,128,32)))
11model_no_bias.summary()
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
dense_79 (Dense) (None, 128, 128, 1) 33
=================================================================
Total params: 33
Trainable params: 33
Non-trainable params: 0
_________________________________________________________________
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
dense_80 (Dense) (None, 128, 128, 1) 32
=================================================================
Total params: 32
Trainable params: 32
Non-trainable params: 0
_________________________________________________________________
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。