self._insert_new_layers(new_layers, output_id)
def to_wider_model(self, pre_layer_id, n_add):
Widen the last dimension of the output of the pre_layer.
Args:
pre_layer_id: A convolutional layer or dense layer.
n_add: The number of dimensions to add.
Returns:
A new Keras model with the widened layers.
self.operation_history.append(("to_wider_model", pre_layer_id, n_add))
pre_layer = self.layer_list[pre_layer_id]
output_id = self.layer_id_to_output_node_ids[pre_layer_id][0]
dim = layer_width(pre_layer)
self.vis = {}
self._search(output_id, dim, dim, n_add)
def to_dense_deeper_model(self, target_id):
Insert a dense layer after the target layer.