<commit_before>from athenet.algorithm.derest.derest import derest
from athenet.network import Network
from athenet.layers import ConvolutionalLayer, FullyConnectedLayer,\
    Softmax, ReLU, MaxPool, InceptionLayer, LRN


def aggregating_example_function(values):
    a = values.sum()
    return a.lower + a.upper

n = Network([
    ConvolutionalLayer(image_shape=(28, 28, 1), filter_shape=(4, 4, 2)),
    ReLU(),
    LRN(),
    MaxPool(poolsize=(2, 2)),
#    InceptionLayer(n_filters=[2, 2, 2, 2, 2, 2]),
    FullyConnectedLayer(n_out=10),
    ReLU(),
    FullyConnectedLayer(n_out=3),
    Softmax(),
])

derest(n, 0.6, count_function=aggregating_example_function, max_batch_size=None,
       normalize_activations=True, normalize_derivatives=True)<commit_msg>derest_demo<commit_after>from athenet.algorithm.derest.derest import derest
from athenet.network import Network
from athenet.layers import ConvolutionalLayer, FullyConnectedLayer,\
    Softmax, ReLU, MaxPool, InceptionLayer, LRN


n = Network([
    ConvolutionalLayer(image_shape=(28, 28, 1), filter_shape=(4, 4, 2)),
    ReLU(),
    LRN(),
    MaxPool(poolsize=(2, 2)),
#    InceptionLayer(n_filters=[2, 2, 2, 2, 2, 2]),
    FullyConnectedLayer(n_out=10),
    ReLU(),
    FullyConnectedLayer(n_out=3),
    Softmax(),
])

derest(n, 0.6, max_batch_size=None)
{'fraction_non_alphanumeric': 0.13211845102505695, 'fraction_numerical': 0.03189066059225513, 'mean_word_length': 4.990909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '1261032', 'n_tokens_mistral': 519, 'n_tokens_neox': 470, 'n_words': 95}