我发送了maxout的pull请求,这里是链接:
https://github.com/tensorflow/tensorflow/pull/5528
代码如下:
def maxout(inputs, num_units, axis=None):
shape = inputs.get_shape().as_list()
if axis is None:
# Assume that channel is the last dimension
axis = -1
num_channels = shape[axis]
if num_channels % num_units:
raise ValueError('number of features({}) is not a multiple of num_units({})'
.format(num_channels, num_units))
shape[axis] = -1
shape += [num_channels // num_units]
outputs = tf.reduce_max(tf.reshape(inputs, shape), -1, keep_dims=False)
return outputs
Run Code Online (Sandbox Code Playgroud)
下面是它的工作原理:
| 归档时间: |
|
| 查看次数: |
6103 次 |
| 最近记录: |