anchor.diff:          return self._out_shape
   ----
   
  -Lets look at this step by step. Note that this implementation only illustrates shared weights for all features of `layer_inputs[i]` for simplicity. Se e the full implementation on link:https://github.com/raghakot/deep-learning-experiments/blob/master/exp3/architecture.py#L8[github] for creating a unique weight per feature map from previous layers.
  -
  -1. `_ensure_same_size` computes smallest \((rows, cols)\) amongst all inputs and uses it to resize all inputs to be the same shape. 
  -2. We have to define trainable weights in `build` per keras custom layer link:https://keras.io/layers/writing-your-own-keras-layers/[docs]. We need as many weights and number of inputs.
  +Lets look at this step by step.
  +
  +1. `_ensure_same_size` computes smallest \((rows, cols)\) amongst all inputs and uses it to resize all inputs to be the same shape using the provided resize interpolation scheme.
  +2. We have to define trainable weights in `build` per keras custom layer link:https://keras.io/layers/writing-your-own-keras-layers/[docs]. We need as many weights as sum of filters across all inputs to the `Connection` layer. Weight sharing across all filters of an incoming layer can be achieved by concatenating same weight variable for all filters.
   3. `call` computes sigmoid weighted inputs (I tested without sigmoid, and as expected, sigmoid weighing which mostly "allows or disallows inputs" worked a lot better), merged with defined merge strategy. We can tweak `init_value` and `merge_mode` to try various init strategies for weights and different merge strategies.
   
   The fully connected net using layers defined below, followed by sequential `Dense` layers using the above code is shown in fig.
  
positive.code:         # Find min (row, col) value and resize all inputs to that value.
          rows = min([K.int_shape(x)[1] for x in inputs])
          cols = min([K.int_shape(x)[2] for x in inputs])
          return [tf.image.resize_bilinear(x, [rows, cols]) for x in inputs]
  
      def _merge(self, inputs):
          """Define other merge ops like [+, X, avg] here.
          """
          if self.merge_mode == 'concat':
              return merge(inputs, mode=self.merge_mode, concat_axis=-1)
          else:
              raise RuntimeError('mode {} is invalid'.format(self.merge_mode))
  
      def build(self, input_shape):
          # Create a trainable weight variable for this connection
          self.W = [K.variable(np.ones(shape=1) * self.init_value) for _ in range(len(input_shape))]
          self._trainable_weights.extend(self.W)
          super(Connection, self).build(input_shape)
  
      def call(self, layer_inputs, mask=None):
  
negative.code:         resized_inputs = self._ensure_same_size(layer_inputs)
  
          # Compute sigmoid weighted inputs
          stacked = K.concatenate(resized_inputs, axis=-1)
          weighted = stacked * K.sigmoid(self.W)
  
          # Merge according to provided merge strategy.
          merged = self._merge(weighted)
  
          # Cache this for use in `get_output_shape_for`
          self._out_shape = K.int_shape(merged)
  