def base_model(input_shapes):
from keras.layers import Input
from keras.layers.core import Masking
x_global = Input(shape=input_shapes[0])
x_charged = Input(shape=input_shapes[1])
x_neutral = Input(shape=input_shapes[2])
x_ptreco = Input(shape=input_shapes[3])
lstm_c = Masking()(x_charged)
lstm_c = LSTM(100,go_backwards=True,implementation=2)(lstm_c)
lstm_n = Masking()(x_neutral)
lstm_n = LSTM(100,go_backwards=True,implementation=2)(lstm_n)
x = concatenate( [lstm_c, lstm_n, x_global] )
x = Dense(200, activation='relu',kernel_initializer='lecun_uniform')(x)
x = Dense(100, activation='relu',kernel_initializer='lecun_uniform')(x)
x = Dense(100, activation='relu',kernel_initializer='lecun_uniform')(x)
x = Dense(100, activation='relu',kernel_initializer='lecun_uniform')(x)
x = Dense(100, activation='relu',kernel_initializer='lecun_uniform')(x)
x = Dense(100, activation='relu',kernel_initializer='lecun_uniform')(x)
x = concatenate([x, x_ptreco])
return [x_global, x_charged, x_neutral, x_ptreco], x
评论列表
文章目录