<jupyter_start><jupyter_text>Diverse templates with no natural image prior<jupyter_code>layer_name = 'conv3/conv3_1'
distance_layer_name = 'conv2/conv2_2' # set to None for pixel space distance
unit_num = 21 # Feature map
num_images = 6
dist_weight = 0.01 # referred to \lambda in the paper
naturalness = 0.0
subspace_net = dvis.SubspaceNet(layer_name, unit_num, num_images, dist_weight, naturalness, feature_layer_name=distance_layer_name)
images, predictions, min_distance, mean_distance, loss = subspace_net.map_subspace(callback=dvis.callback, callback_every=500, max_iter=2000)
avg_rate = predictions.mean()
print('Done after {:d} iterations (avg rate = {:.2f})'.format(len(loss), avg_rate))<jupyter_output>INFO:tensorflow:Restoring parameters from networks/vgg_normalized.ckpt
Iteration 500 | Loss: -55.33 | Diversity: 0.05 | Naturalness: 0.00 | Avg activation: 55.27
Activations: [55.651367 58.880478 57.554626 51.55833  53.742302 54.243538]<jupyter_text>Diverse templates with PixelCNN++ prior<jupyter_code>layer_name = 'conv3/conv3_1'
distance_layer_name = 'conv2/conv2_2' # set to None for pixel space distance
unit_num = 21 # Feature map
num_images = 6
dist_weight = 0.01 # referred to \lambda in the paper
naturalness = 0.0001
subspace_net = dvis.SubspaceNet(layer_name, unit_num, num_images, dist_weight, naturalness, feature_layer_name=distance_layer_name)
images, predictions, min_distance, mean_distance, loss = subspace_net.map_subspace(callback=dvis.callback, callback_every=500, max_iter=2000)
avg_rate = predictions.mean()
print('Done after {:d} iterations (avg rate = {:.2f})'.format(len(loss), avg_rate))<jupyter_output>INFO:tensorflow:Restoring parameters from networks/vgg_normalized.ckpt
INFO:tensorflow:Restoring parameters from networks/pxpp_cifar.ckpt
{'fraction_non_alphanumeric': 0.10230466554243957, 'fraction_numerical': 0.06239460370994941, 'mean_word_length': 7.436018957345971, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '120995', 'license': 'MIT', 'n_tokens_mistral': 677, 'n_tokens_neox': 598, 'n_words': 141, 'path': 'DiverseVisualizationsVGG.ipynb', 'repo_name': 'sacadena/diverse_feature_vis', 'size': '1779'}