def _init_from_scratch(self):
"""Initialize a model from scratch."""
if self.model_name == 'bmwacor':
self.model = self.bmwacor_model()
if self.model_name == 'bilstm_split':
self.model = self.bilstm_split_model()
if self.model_name == 'full_match':
self.model = self.full_match_model()
if self.model_name == 'maxpool_match':
self.model = self.maxpool_match_model()
if self.model_name == 'att_match':
self.model = self.att_match_model()
if self.model_name == 'maxatt_match':
self.model = self.maxatt_match_model()
if self.model_name == 'bilstm_woatt':
self.model = self.bilstm_woatt_model()
optimizer = Adam(lr=self.learning_rate)
self.model.compile(loss='binary_crossentropy',
optimizer=optimizer,
metrics=['accuracy', fbeta_score])
评论列表
文章目录