def to_conv_deeper_model(self, target_id, kernel_size): """Insert a relu-conv-bn block after the target block. Args: target_id: A convolutional layer ID. The new block should be inserted after the block. kernel_size: An integer. The kernel size of the new convolutional layer. """ self.operation_history.append(('to_conv_deeper_model', target_id, kernel_size)) target = self.layer_list[target_id] new_layers = deeper_conv_block(target, kernel_size, self.weighted) output_id = self._conv_block_end_node(target_id) self._insert_new_layers(new_layers, output_id)
def to_conv_deeper_model(self, target_id, kernel_size): """Insert a convolution, batch-normalization, relu block after the target block. Args: target_id: A convolutional layer ID. The new block should be inserted after the relu layer in its conv-batch-relu block. kernel_size: An integer. The kernel size of the new convolutional layer. Returns: A new Keras model with the inserted block. """ self.operation_history.append( ('to_conv_deeper_model', target_id, kernel_size)) target = self.layer_list[target_id] new_layers = deeper_conv_block(target, kernel_size, self.weighted) output_id = self._conv_block_end_node(target_id) self._insert_new_layers(new_layers, output_id)
def _deeper_conv_block(self, target, kernel_size): return deeper_conv_block(target, kernel_size)