def update_neuron_coverage(input_data, model, model_layer_dict, threshold=0):
    layer_names = [layer.name for layer in model.layers if (('flatten' not in layer.name) and ('input' not in layer.name))]
    intermediate_layer_model = Model(inputs=model.input, outputs=[model.get_layer(layer_name).output for layer_name in layer_names])
    intermediate_layer_outputs = intermediate_layer_model.predict(input_data)
    for (i, intermediate_layer_output) in enumerate(intermediate_layer_outputs):
        scaled = scale(intermediate_layer_output[0])
        for num_neuron in range(scaled.shape[(- 1)]):
            if ((np.mean(scaled[(..., num_neuron)]) > threshold) and (not model_layer_dict[(layer_names[i], num_neuron)])):
                model_layer_dict[(layer_names[i], num_neuron)] = True
                print('new coverage found')
def update_neuron_coverage(input_data, model, model_layer_dict, threshold=0):
    layer_names = [layer.name for layer in model.layers if (('flatten' not in layer.name) and ('input' not in layer.name))]
    intermediate_layer_model = Model(inputs=model.input, outputs=[model.get_layer(layer_name).output for layer_name in layer_names])
    intermediate_layer_outputs = intermediate_layer_model.predict(input_data)
    for (i, intermediate_layer_output) in enumerate(intermediate_layer_outputs):
        scaled = scale(intermediate_layer_output[0])
        for num_neuron in range(scaled.shape[(- 1)]):
            if ((np.mean(scaled[(..., num_neuron)]) > threshold) and (not model_layer_dict[(layer_names[i], num_neuron)])):
                model_layer_dict[(layer_names[i], num_neuron)] = True
                print('new coverage found')