def test_keras_import(self):
# softmax
model = Sequential()
model.add(Activation('softmax', input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'Softmax')
# relu
model = Sequential()
model.add(Activation('relu', input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'ReLU')
# tanh
model = Sequential()
model.add(Activation('tanh', input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'TanH')
# sigmoid
model = Sequential()
model.add(Activation('sigmoid', input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'Sigmoid')
# selu
model = Sequential()
model.add(Activation('selu', input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'SELU')
# softplus
model = Sequential()
model.add(Activation('softplus', input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'Softplus')
# softsign
model = Sequential()
model.add(Activation('softsign', input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'Softsign')
# hard_sigmoid
model = Sequential()
model.add(Activation('hard_sigmoid', input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'HardSigmoid')
# LeakyReLU
model = Sequential()
model.add(LeakyReLU(alpha=1, input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'ReLU')
# PReLU
model = Sequential()
model.add(PReLU(input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'PReLU')
# ELU
model = Sequential()
model.add(ELU(alpha=1, input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'ELU')
# ThresholdedReLU
model = Sequential()
model.add(ThresholdedReLU(theta=1, input_shape=(15,)))
model.build()
self.keras_type_test(model, 0, 'ThresholdedReLU')
评论列表
文章目录