| 1250 | """ |
| 1251 | |
| 1252 | def __init__(self, |
| 1253 | rank, |
| 1254 | filters, |
| 1255 | kernel_size, |
| 1256 | strides=1, |
| 1257 | padding='valid', |
| 1258 | data_format=None, |
| 1259 | dilation_rate=1, |
| 1260 | depth_multiplier=1, |
| 1261 | activation=None, |
| 1262 | use_bias=True, |
| 1263 | depthwise_initializer='glorot_uniform', |
| 1264 | pointwise_initializer='glorot_uniform', |
| 1265 | bias_initializer='zeros', |
| 1266 | depthwise_regularizer=None, |
| 1267 | pointwise_regularizer=None, |
| 1268 | bias_regularizer=None, |
| 1269 | activity_regularizer=None, |
| 1270 | depthwise_constraint=None, |
| 1271 | pointwise_constraint=None, |
| 1272 | bias_constraint=None, |
| 1273 | trainable=True, |
| 1274 | name=None, |
| 1275 | **kwargs): |
| 1276 | super(SeparableConv, self).__init__( |
| 1277 | rank=rank, |
| 1278 | filters=filters, |
| 1279 | kernel_size=kernel_size, |
| 1280 | strides=strides, |
| 1281 | padding=padding, |
| 1282 | data_format=data_format, |
| 1283 | dilation_rate=dilation_rate, |
| 1284 | activation=activations.get(activation), |
| 1285 | use_bias=use_bias, |
| 1286 | bias_initializer=initializers.get(bias_initializer), |
| 1287 | bias_regularizer=regularizers.get(bias_regularizer), |
| 1288 | activity_regularizer=regularizers.get(activity_regularizer), |
| 1289 | bias_constraint=bias_constraint, |
| 1290 | trainable=trainable, |
| 1291 | name=name, |
| 1292 | **kwargs) |
| 1293 | self.depth_multiplier = depth_multiplier |
| 1294 | self.depthwise_initializer = initializers.get(depthwise_initializer) |
| 1295 | self.pointwise_initializer = initializers.get(pointwise_initializer) |
| 1296 | self.depthwise_regularizer = regularizers.get(depthwise_regularizer) |
| 1297 | self.pointwise_regularizer = regularizers.get(pointwise_regularizer) |
| 1298 | self.depthwise_constraint = constraints.get(depthwise_constraint) |
| 1299 | self.pointwise_constraint = constraints.get(pointwise_constraint) |
| 1300 | |
| 1301 | def build(self, input_shape): |
| 1302 | input_shape = tensor_shape.TensorShape(input_shape) |