@@ -38,8 +38,6 @@ def __init__(self, output_dimesion, vocab_size, dropout_rate, emb_dim, max_len,
38
38
# self.qual_model = Model()
39
39
self .qual_conv_set = {}
40
40
41
- filter_lengths = [3 , 4 , 5 ]
42
-
43
41
# my code
44
42
'''Input'''
45
43
input_data = Input (shape = (max_len , ), name = 'input' , dtype = 'int32' )
@@ -169,8 +167,8 @@ def train(self, X_train, V, item_weight, seed):
169
167
item_weight = np .random .permutation (item_weight )
170
168
171
169
print ("Train...CNN module" )
172
- history = self .model .fit ({ 'input' : X_train , 'output' : V } ,
173
- verbose = 0 , batch_size = self . batch_size , nb_epoch = self .nb_epoch , sample_weight = { 'output' : item_weight } )
170
+ history = self .model .fit (X_train , V , verbose = 0 , batch_size = self . batch_size ,
171
+ nb_epoch = self .nb_epoch , sample_weight = item_weight )
174
172
175
173
# cnn_loss_his = history.history['loss']
176
174
# cmp_cnn_loss = sorted(cnn_loss_his)[::-1]
@@ -180,6 +178,5 @@ def train(self, X_train, V, item_weight, seed):
180
178
181
179
def get_projection_layer (self , X_train ):
182
180
X_train = sequence .pad_sequences (X_train , maxlen = self .max_len )
183
- Y = self .model .predict (
184
- {'input' : X_train }, batch_size = len (X_train ))['output' ]
181
+ Y = self .model .predict (X_train , batch_size = len (X_train ))
185
182
return Y
0 commit comments