<commit_before>﻿using System;

namespace NeuralNetwork
{
    public class Network
    {
        public Network(Sigmoid activation, double learningRate, int inputSize, int outputSize, params int[] hiddenLayers)
        {
            this.activation = activation;

            //Initialize the neural layers. These layers will be static and therefore will be contained within an array.
        }

        #region Fields

        private Sigmoid activation;

        /// <summary>
        /// The neurons and their respective layers (self contained within the network).
        /// These neurons along with their respective layers  will be constant during runtime, therefore an array is used.
        /// </summary>
        private Neuron[][] neurons;

        #endregion Fields

        #region Helpers

        /// <summary>
        /// Generates random numbers associated with the neural network.
        /// </summary>
        public static Random R = new Random();

        #endregion Helpers
    }
}<commit_msg>Completed Layer-Neuron initialization. #4<commit_after>﻿using NeuralNetwork.Neurons;
using System;

namespace NeuralNetwork
{
    public class Network
    {
        public Network(Sigmoid activation, double learningRate, int inputSize, int outputSize, params int[] hiddenLayers)
        {
            this.activation = activation;
            this.Bias = new BiasNeuron();

            #region Layer Initialization
            //Initialize the neural layers. These layers will be static and therefore will be contained within an array.
            int layerCount = 2 + ((hiddenLayers == null) ? 0 : hiddenLayers.Length);
            neurons = new Neuron[layerCount][];

            //Initialize the layers and connections thereof.
            for(int layer = 0; layer < layerCount; layer++)
            {
                //Count is equal to the respective size of the layers.
                int count = (layer == 0) ? inputSize :
                    (layer == layerCount -1) ? outputSize
                        : hiddenLayers[layer -1];

                neurons[layer] = new Neuron[count];

                //Fill the layer with neurons.
                for (int k = 0; k < count; k++){
                    if (layer == 0) //Input
                        neurons[layer][k] = new InputNeuron();
                    else if (layer == layerCount - 1) //Output
                        neurons[layer][k] = new OutputNeuron();
                    else //Hidden
                        neurons[layer][k] = new HiddenNeuron();
                }
            }
            #endregion Layer Initialization


        }

        #region Fields

        private Sigmoid activation;

        /// <summary>
        /// The neurons and their respective layers (self contained within the network).
        /// These neurons along with their respective layers  will be constant during runtime, therefore an array is used.
        /// </summary>
        private Neuron[][] neurons;

        /// <summary>
        /// The array of connections on every layer. The first connection is always the bias.
        /// </summary>
        private Connection[][] connections;

        #endregion Fields

        #region Properties

        /// <summary>
        /// The neural network's bias.
        /// </summary>
        public BiasNeuron Bias { private set; get; }

        #endregion

        #region Helpers

        /// <summary>
        /// Generates random numbers associated with the neural network.
        /// </summary>
        public static Random R = new Random();

        #endregion Helpers
    }
}
{'fraction_non_alphanumeric': 0.08858650374895863, 'fraction_numerical': 0.0027770063871146904, 'mean_word_length': 1.7103085026335592, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '3296635', 'n_tokens_mistral': 893, 'n_tokens_neox': 817, 'n_words': 323}