<commit_before>import copy
import neurons

class InputLayer:
    def __init__(self, num_neurons):
        self._layer = Layer(num_neurons, neurons.InputNeuron)

    @property
    def neurons(self):
        return self._layer.neurons
    
    def connect_layer(self, other):
        self._layer.connect_layer(other)

    def set_inputs(self, inputs):
        '''
        inputs: An ordered collection of floats that is matched to each neuron
        '''
        if len(inputs) != len(self._layer.neurons):
            raise ValueError(("inputs must have as many elements are there"
                              "are neurons"))
        for idx, n in enumerate(self._layer.neurons):
            n.signal = inputs[idx]

class OutputLayer:
    def __init__(self, num_neurons):
        self._layer = Layer(num_neurons, neurons.OutputNeuron)

    @property
    def neurons(self):
        return self._layer._neurons

    def connect_layer(self, other):
        self._layer.connect_layer(other)

    def propagate(self):
        self._layer.propagate()

    def backpropagate1(self, target):
        for n in self._layer._neurons:
            n.backpropagate1(target)

    def backpropagate2(self):
        self._layer.backpropagate2()

class Layer:
    def __init__(self, num_neurons, neuron_type=neurons.Neuron, neuron_params=()):
        self._neurons = [neuron_type(*neuron_params) for x in range(num_neurons)]
<commit_msg>Fix mistake<commit_after>import copy
import neurons

class InputLayer:
    def __init__(self, num_neurons):
        self._layer = Layer(num_neurons, neurons.InputNeuron)

    @property
    def neurons(self):
        return self._layer.neurons
    
    def connect_layer(self, other):
        self._layer.connect_layer(other)

    def set_inputs(self, inputs):
        '''
        inputs: An ordered collection of floats that is matched to each neuron
        '''
        if len(inputs) != len(self._layer.neurons):
            raise ValueError(("inputs must have as many elements are there"
                              "are neurons"))
        for idx, n in enumerate(self._layer.neurons):
            n.signal = inputs[idx]

class OutputLayer:
    def __init__(self, num_neurons):
        self._layer = Layer(num_neurons, neurons.OutputNeuron)

    @property
    def neurons(self):
        return self._layer._neurons

    def connect_layer(self, other):
        self._layer.connect_layer(other)

    def propagate(self):
        self._layer.propagate()

    def backpropagate1(self, targetlabels):
        for idx, n in enumerate(self._layer._neurons):
            n.backpropagate1(targetlabels[idx])

    def backpropagate2(self):
        self._layer.backpropagate2()

class Layer:
    def __init__(self, num_neurons, neuron_type=neurons.Neuron, neuron_params=()):
        self._neurons = [neuron_type(*neuron_params) for x in range(num_neurons)]

{'fraction_non_alphanumeric': 0.09648206199930338, 'fraction_numerical': 0.002786485545106235, 'mean_word_length': 2.696267696267696, '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': '1390626', 'n_tokens_mistral': 889, 'n_tokens_neox': 829, 'n_words': 204}