if "normalization_activations" in \
eval(config["output"]["plot_vars"]):
print("Writing activations to disk...")
np.savez_compressed(os.path.join(activ_dir, layer.name),
activations)
nonzero_activations = activations[np.nonzero(activations)]
del activations
perc = get_percentile(config, i)
scale_facs[layer.name] = get_scale_fac(nonzero_activations, perc)
After Change
activations = try_reload_activations(layer, model, x_norm,
batch_size, activ_dir)
if activations is None:
continue
// Compute activations with modified parameters
nonzero_activations = activations[np.nonzero(activations)]
activations_norm = get_activations_layer(model.input, layer.output,
x_norm, batch_size)
activation_dict = {