Beispiel #1
0
  def call(self, inputs):
    output = K.local_conv2d(inputs, self.kernel, self.kernel_size, self.strides,
                            (self.output_row, self.output_col),
                            self.data_format)

    if self.use_bias:
      output = K.bias_add(output, self.bias, data_format=self.data_format)

    output = self.activation(output)
    return output
Beispiel #2
0
 def call(self, inputs):
     frep_parts = tf.split(inputs, self.splitaxis, -1)
     convs = []
     for i, frep_part in enumerate(frep_parts):
         individual_channels = tf.split(frep_part, frep_part.shape[-1], -1)
         for ind_ch in individual_channels:
             conv = K.local_conv2d(ind_ch, self.kernels[i],
                                   self.kernel_size, self.strides,
                                   (self.output_row, self.output_col),
                                   self.data_format)
             convs.append(conv)
     outputs = tf.concat(convs, -1)
     if self.use_bias:
         outputs = K.bias_add(outputs,
                              self.bias,
                              data_format=self.data_format)
     outputs = self.activation(outputs)
     return outputs