Exemple #1
0
 public void Initialize(int nNodesInput, int nNodesHidden, int nNodesOutput)
 {
     InputLayer.nodeCount       = nNodesInput;
     InputLayer.childNodeCount  = nNodesHidden;
     InputLayer.parentNodeCount = 0;
     InputLayer.Initialize(nNodesInput, null, HiddenLayer);
     InputLayer.RandomizeWeights();
     HiddenLayer.nodeCount       = nNodesHidden;
     HiddenLayer.childNodeCount  = nNodesOutput;
     HiddenLayer.parentNodeCount = nNodesInput;
     HiddenLayer.Initialize(nNodesHidden, InputLayer, OutputLayer);
     HiddenLayer.RandomizeWeights();
     OutputLayer.nodeCount       = nNodesOutput;
     OutputLayer.childNodeCount  = 0;
     OutputLayer.parentNodeCount = nNodesHidden;
     OutputLayer.Initialize(nNodesOutput, HiddenLayer, null);
 }
Exemple #2
0
    // 初期化する
    public void Initialize(int nNodesInput, int nNodesHidden, int nNodesOutput)
    {
        InputLayer.NumberOfNodes       = nNodesInput;
        InputLayer.NumberOfChildNodes  = nNodesHidden;
        InputLayer.NumberOfParentNodes = 0;
        InputLayer.Initialize(nNodesInput, null, HiddenLayer);
        InputLayer.RandomizeWeights();

        HiddenLayer.NumberOfNodes       = nNodesHidden;
        HiddenLayer.NumberOfChildNodes  = nNodesOutput;
        HiddenLayer.NumberOfParentNodes = nNodesInput;
        HiddenLayer.Initialize(nNodesHidden, InputLayer, OutputLayer);
        HiddenLayer.RandomizeWeights();

        OutputLayer.NumberOfNodes       = nNodesOutput;
        OutputLayer.NumberOfChildNodes  = 0;
        OutputLayer.NumberOfParentNodes = nNodesHidden;
        OutputLayer.Initialize(nNodesOutput, HiddenLayer, null);
    }
    public void Initialize(int nNodesInput, int nNodesHidden, int nNodesOutput)
    {
        InputLayer = new NeuralNetworkLayer();
        HiddenLayer = new NeuralNetworkLayer();
        OutputLayer = new NeuralNetworkLayer();

        InputLayer.NumberOfNodes = nNodesInput;
        InputLayer.NumberOfChildNodes = nNodesHidden;
        InputLayer.NumberOfParentNodes = 0;
        NeuralNetworkLayer[] n = new NeuralNetworkLayer[2];
        n[0] = null;
        n[1] = HiddenLayer;
        InputLayer.Initialize(nNodesInput, n);
        InputLayer.RandomizeWeights();

        HiddenLayer.NumberOfNodes = nNodesHidden;
        HiddenLayer.NumberOfChildNodes = nNodesOutput;
        HiddenLayer.NumberOfParentNodes = nNodesInput;
        n = new NeuralNetworkLayer[2];
        n[0] = InputLayer;
        n[1] = OutputLayer;
        HiddenLayer.Initialize(nNodesHidden, n);
        HiddenLayer.RandomizeWeights();

        OutputLayer.NumberOfNodes = nNodesOutput;
        OutputLayer.NumberOfChildNodes = 0;
        OutputLayer.NumberOfParentNodes = nNodesHidden;
        n = new NeuralNetworkLayer[2];
        n[0] = HiddenLayer;
        n[1] = null;
        OutputLayer.Initialize(nNodesOutput, n);
    }