def modelC256P3C256P3C256P3f128_conc_f128(inputLength, inputDim):
inputA = Input(shape=(inputLength,), dtype='int32')
inputB = Input(shape=(inputLength,), dtype='int32')
# One hot encoding
oheInputA = Lambda(K.one_hot, arguments={
'num_classes': inputDim}, output_shape=(inputLength, inputDim))(inputA)
oheInputB = Lambda(K.one_hot, arguments={
'num_classes': inputDim}, output_shape=(inputLength, inputDim))(inputB)
net = netC256P3C256P3C256P3f128(inputLength, inputDim)
processedA = net(oheInputA)
processedB = net(oheInputB)
# Concatenate
conc = Concatenate()([processedA, processedB])
x = BatchNormalization()(conc)
# Dense
x = Dense(128, activation='relu')(x)
x = Dropout(0.5)(x)
x = BatchNormalization()(x)
predictions = Dense(1, activation='sigmoid')(x)
model = Model([inputA, inputB], predictions)
return model
testSigmoidSmaller.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录