def get_layer_visualizations(self, net, layers='all'):
        # add visualizations
        visualizations = []
        if layers and layers != 'none':
            if layers == 'all':
                added_activations = []
                for layer in self.network.layer:
                    for bottom in layer.bottom:
                        if bottom in net.blobs and bottom not in added_activations:
                            data = net.blobs[bottom].data[0]
                            vis = utils.image.get_layer_vis_square(data,
                                    allow_heatmap=bool(bottom != 'data'))
                            mean, std, hist = self.get_layer_statistics(data)
                            visualizations.append(
                                    {
                                        'name': str(bottom),
                                        'vis_type': 'Activation',
                                        'vis': vis,
                                        'data_stats': {
                                            'shape': data.shape,
                                            'mean': mean,
                                            'stddev': std,
                                            'histogram': hist,
                                            },
                                        }
                                    )
                            added_activations.append(bottom)
                    if layer.name in net.params:
                        data = net.params[layer.name][0].data
                        if layer.type not in ['InnerProduct']:
                            vis = utils.image.get_layer_vis_square(data)
                        else:
                            vis = None
                        mean, std, hist = self.get_layer_statistics(data)
                        params = net.params[layer.name]
                        weight_count = reduce(operator.mul, params[0].data.shape, 1)
                        if len(params) > 1:
                            bias_count = reduce(operator.mul, params[1].data.shape, 1)
                        else:
                            bias_count = 0
                        parameter_count = weight_count + bias_count
                        visualizations.append(
                                {
                                    'name': str(layer.name),
                                    'vis_type': 'Weights',
                                    'layer_type': layer.type,
                                    'param_count': parameter_count,
                                    'vis': vis,
                                    'data_stats': {
                                        'shape': data.shape,
                                        'mean': mean,
                                        'stddev': std,
                                        'histogram': hist,
                                        },
                                    }
                                )
                    for top in layer.top:
                        if top in net.blobs and top not in added_activations:
                            data = net.blobs[top].data[0]
                            normalize = True
                            # don't normalize softmax layers
                            if layer.type == 'Softmax':
                                normalize = False
                            vis = utils.image.get_layer_vis_square(data,
                                    normalize = normalize,
                                    allow_heatmap = bool(top != 'data'))
                            mean, std, hist = self.get_layer_statistics(data)
                            visualizations.append(
                                    {
                                        'name': str(top),
                                        'vis_type': 'Activation',
                                        'vis': vis,
                                        'data_stats': {
                                            'shape': data.shape,
                                            'mean': mean,
                                            'stddev': std,
                                            'histogram': hist,
                                            },
                                        }
                                    )
                            added_activations.append(top)
            else:
                raise NotImplementedError

        return visualizations
Shell escape the given string
dataset/ETHPy150Open NVIDIA/DIGITS/digits/model/tasks/caffe_train.py/CaffeTrainTask.get_layer_visualizations--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/zshcomp.py/escape