简体   繁体   中英

element-wise divison in Keras

is there any way of implementing an element-wise division in keras. What i'm searching for is some kind of merge-layer that divides two inputs element by element. But i didn't find anything like this in keras. Does anyone know a way to do this?

You can use a Lambda layer :

from keras.layers import Lambda

input1 = ...
input2 = ...
result = Lambda(lambda inputs: inputs[0] / inputs[1])([input1, input2])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM