コード例 #1
0
        public Vector <float> FeedForward(Vector <float> inputs)
        {
            Vector <float> hiddenActivations = HiddenWeights
                                               .Multiply(inputs)
                                               .Add(HiddenBiases)
                                               .Map(NetworkParameters.HiddenLayerActivationFunction);

            return(OutputWeights
                   .Multiply(hiddenActivations)
                   .Add(OutputBiases)
                   .Map(NetworkParameters.OutputLayerActivationFunction));
        }
コード例 #2
0
 public string ToFullParamsString()
 {
     return($"{NetworkParameters.InputCount}-{NetworkParameters.HiddenLayerNeuronCount}\n" +
            $"{HiddenWeights.ToMatrixString()}\n{HiddenBiases.ToVectorString()}\n{OutputWeights.ToMatrixString()}\n{OutputBiases.ToVectorString()}");
 }
コード例 #3
0
 public override string ToString()
 {
     return($"{NetworkParameters.InputCount}-{NetworkParameters.HiddenLayerNeuronCount} " +
            $"{HiddenWeights.GetHashCode()},{HiddenBiases.GetHashCode()},{OutputWeights.GetHashCode()},{OutputBiases.GetHashCode()}");
 }
コード例 #4
0
 public NeuralNetwork Clone()
 {
     return(new NeuralNetwork(HiddenWeights.Clone(), HiddenBiases.Clone(), OutputWeights.Clone(),
                              OutputBiases.Clone(), NetworkParameters.HiddenLayerActivationFunction, NetworkParameters.OutputLayerActivationFunction));
 }