public ParticleSwarm(ParticleSwarmConfiguration configuration)
 {
     _random = new Random(0);
     _configuration = configuration;
     var weights = _configuration.NeuralNetwork.GetWeights();
     _vectorSize = weights.Length;
     _swarm = new Particle[configuration.NumbeOfParticles];
     ParticleDeathProbability = 0.5;
     InertiaWeight = 0.729;
 }
        public ParticleSwarmNeuralNetwork(NeuralNetworkConfiguration configuration, ParticleSwarmConfiguration particleSwarmConfiguration)
        {
            _configuration = configuration;
            _particleSwarmConfiguration = particleSwarmConfiguration;

            _hiddenBiases = new double[configuration.NumberOfHiddenNodes];
            _hiddenOutputs = new double[configuration.NumberOfHiddenNodes];

            _outputBiases = new double[configuration.NumberOfOutputNodes];
            _outputs = new double[configuration.NumberOfOutputNodes];
            _inputs = new double[configuration.NumberOfInputNodes];
            _hiddenOutputWeights = NeuralNetworkHelpers.CreateMatrix(configuration.NumberOfHiddenNodes, configuration.NumberOfOutputNodes);

            _hiddenInputWeights = NeuralNetworkHelpers.CreateMatrix(configuration.NumberOfInputNodes, configuration.NumberOfHiddenNodes);

            _numberOfWeights = DetermineNumberOfWeightsAndBiases();
        }