def test_tiny_separable_conv_same_fancy_depth_multiplier(
self,
model_precision=_MLMODEL_FULL_PRECISION):
np.random.seed(1988)
input_dim = 16
input_shape = (input_dim, input_dim, 3)
depth_multiplier = 2
kernel_height = 3
kernel_width = 3
num_kernels = 40
# Define a model
model = Sequential()
model.add(SeparableConv2D(filters = num_kernels, kernel_size=(kernel_height, kernel_width),
padding = 'same', strides = (2,2), activation='relu', depth_multiplier = depth_multiplier,
input_shape = input_shape))
# Set some random weights
model.set_weights([np.random.rand(*w.shape) for w in model.get_weights()])
# Test the keras model
self._test_keras_model(model, model_precision=model_precision)
评论列表
文章目录