132924d0468c72ba081900ba97013b8353a85f3b,sonnet/python/modules/conv.py,SeparableConv2D,_build,#SeparableConv2D#Any#,2638
Before Change
self._input_channels, self._channel_multiplier)
pointwise_input_size = self._channel_multiplier * self._input_channels
pointwise_weight_shape = (1, 1, pointwise_input_size, self._output_channels)
bias_shape = (self._output_channels,)
if "w_dw" not in self._initializers:
fan_in_shape = depthwise_weight_shape[:2]
self._initializers["w_dw"] = create_weight_initializer(fan_in_shape,
dtype=inputs.dtype)
if "w_pw" not in self._initializers:
fan_in_shape = pointwise_weight_shape[:3]
self._initializers["w_pw"] = create_weight_initializer(fan_in_shape,
dtype=inputs.dtype)
if "b" not in self._initializers and self._use_bias:
self._initializers["b"] = create_bias_initializer(bias_shape,
dtype=inputs.dtype)
self._w_dw = tf.get_variable(
"w_dw",
shape=depthwise_weight_shape,
dtype=inputs.dtype,
initializer=self._initializers["w_dw"],
partitioner=self._partitioners.get("w_dw", None),
regularizer=self._regularizers.get("w_dw", None))
self._w_pw = tf.get_variable(
"w_pw",
shape=pointwise_weight_shape,
dtype=inputs.dtype,
initializer=self._initializers["w_pw"],
partitioner=self._partitioners.get("w_pw", None),
regularizer=self._regularizers.get("w_pw", None))
outputs = tf.nn.separable_conv2d(inputs,
self._w_dw,
self._w_pw,
strides=self._stride,
padding=self._padding,
data_format=self._data_format)
if self._use_bias:
self._b = tf.get_variable("b",
shape=bias_shape,
dtype=inputs.dtype,
initializer=self._initializers["b"],
partitioner=self._partitioners.get("b", None),
regularizer=self._regularizers.get("b", None))
outputs = tf.nn.bias_add(outputs, self._b, data_format=self._data_format)
return outputs
@property
After Change
partitioner=self._partitioners.get("w_pw", None),
regularizer=self._regularizers.get("w_pw", None))
outputs = tf.nn.separable_conv2d(inputs,
self._w_dw,
self._w_pw,
strides=self._stride,
padding=self._padding,
data_format=self._data_format)
if self._use_bias:
self._b, outputs = _apply_bias(
inputs, outputs, self._channel_index, self._data_format,
self._output_channels, self._initializers, self._partitioners,
self._regularizers)
return outputs
@property
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 40
Instances
Project Name: deepmind/sonnet
Commit Name: 132924d0468c72ba081900ba97013b8353a85f3b
Time: 2018-01-29
Author: noreply@google.com
File Name: sonnet/python/modules/conv.py
Class Name: SeparableConv2D
Method Name: _build
Project Name: deepmind/sonnet
Commit Name: 132924d0468c72ba081900ba97013b8353a85f3b
Time: 2018-01-29
Author: noreply@google.com
File Name: sonnet/python/modules/conv.py
Class Name: SeparableConv2D
Method Name: _build
Project Name: deepmind/sonnet
Commit Name: 132924d0468c72ba081900ba97013b8353a85f3b
Time: 2018-01-29
Author: noreply@google.com
File Name: sonnet/python/modules/conv.py
Class Name: InPlaneConv2D
Method Name: _build
Project Name: deepmind/sonnet
Commit Name: 132924d0468c72ba081900ba97013b8353a85f3b
Time: 2018-01-29
Author: noreply@google.com
File Name: sonnet/python/modules/conv.py
Class Name: DepthwiseConv2D
Method Name: _build