示例#1
0
 def __init__(self, rank,
              filters,
              kernel_size,
              strides=1,
              padding='valid',
              data_format='channels_last',
              dilation_rate=1,
              activation=None,
              use_bias=True,
              kernel_initializer=None,
              bias_initializer=init_ops.zeros_initializer(),
              kernel_regularizer=None,
              bias_regularizer=None,
              activity_regularizer=None,
              trainable=True,
              name=None,
              **kwargs):
     super(_Conv, self).__init__(trainable=trainable, name=name, **kwargs)
     self.rank = rank
     self.filters = filters
     self.kernel_size = utils.normalize_tuple(kernel_size, rank, 'kernel_size')
     self.strides = utils.normalize_tuple(strides, rank, 'strides')
     self.padding = utils.normalize_padding(padding)
     self.data_format = utils.normalize_data_format(data_format)
     self.dilation_rate = utils.normalize_tuple(dilation_rate, rank, 'dilation_rate')
     self.activation = activation
     self.use_bias = use_bias
     self.kernel_initializer = kernel_initializer
     self.bias_initializer = bias_initializer
     self.kernel_regularizer = kernel_regularizer
     self.bias_regularizer = bias_regularizer
     self.activity_regularizer = activity_regularizer
     self.input_spec = base.InputSpec(ndim=self.rank + 2)
示例#2
0
文件: pooling.py 项目: neopenx/Dragon
 def __init__(self, pool_function, pool_size, strides,
              padding='valid', data_format='channels_last',
              name=None, **kwargs):
     super(_Pooling2D, self).__init__(name=name, **kwargs)
     self.pool_function = pool_function
     self.pool_size = utils.normalize_tuple(pool_size, 2, 'pool_size')
     self.strides = utils.normalize_tuple(strides, 2, 'strides')
     self.padding = utils.normalize_padding(padding)
     self.data_format = utils.normalize_data_format(data_format)
     self.input_spec = base.InputSpec(ndim=4)
示例#3
0
 def __init__(self, pool_function, pool_size, strides,
              padding='valid', data_format='channels_last',
              name=None, **kwargs):
     super(_Pooling2D, self).__init__(name=name, **kwargs)
     self.pool_function = pool_function
     self.pool_size = utils.normalize_tuple(pool_size, 2, 'pool_size')
     self.strides = utils.normalize_tuple(strides, 2, 'strides')
     self.padding = utils.normalize_padding(padding)
     self.data_format = utils.normalize_data_format(data_format)
     self.input_spec = base.InputSpec(ndim=4)