if I have tensors, v
, w
, I know you can multiply them together with
a = Multiply()([v, w])
But what if I want to multiply v
or w
by a scalar?
You can use a Lambda
layer for any other scalar manipulations
Scalar Multiplication:
res5 = Lambda(lambda x: x * 3)(res4)
Scalar Addition:
res5 = Lambda(lambda x: x + 4)(res4)
If you are using tensorflow as your backend, the * operator is supported (see this answer).
a = v * 0.10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With