public ReconhecimentoZonaRN()
 {
     redeNeural = RecuperarRede();
     if (redeNeural == null)
     {
         redeNeural = Treinar(4, 0.25, 10000);
     }
 }
Beispiel #2
0
        //Initialize agent's parameters
        public override void agent_init(char type, bool policy, string agentName, int inputCount)
        {
            //Initialize neural net
            LinearLayer  inputLayer  = new LinearLayer(inputCount + 1);
            SigmoidLayer hiddenLayer = new SigmoidLayer(150);
            LinearLayer  outputLayer = new LinearLayer(1);

            new BackpropagationConnector(inputLayer, hiddenLayer).Initializer  = new RandomFunction(-0.5, 0.5);
            new BackpropagationConnector(hiddenLayer, outputLayer).Initializer = new RandomFunction(-0.5, 0.5);

            this.network = new BackpropagationNetwork(inputLayer, outputLayer);

            this.network.SetLearningRate(0.2);
            this.network.Initialize();


            #region Initialize_parameters

            this.name = agentName;
            this.id   = Int32.Parse(agentName.Last().ToString());

            this.agentType    = type;
            this.policyFrozen = policy;

            if (policy)
            {
                this.epsilon = 0;
                this.alpha   = 0;
            }
            else
            {
                this.epsilon = 0.5;
                this.alpha   = 0.2;
            }

            this.gamma = 0.95;
            this.lamda = 0.8;

            currentEpoch = 1;

            initParams();

            #endregion Initialize_parameters
        }
Beispiel #3
0
 //Set agent's neural network
 public override void setNeural(Network net)
 {
     this.network = net;
 }
Beispiel #4
0
 //Set agent's neural network
 public override void setNeural(Network net)
 {
     this.network = net;
 }
Beispiel #5
0
        //Initialize agent's parameters
        public override void agent_init(char type, bool policy, string agentName, int inputCount)
        {
            //Initialize neural net
            LinearLayer inputLayer = new LinearLayer(inputCount + 1);
            SigmoidLayer hiddenLayer = new SigmoidLayer(150);
            LinearLayer outputLayer = new LinearLayer(1);

            new BackpropagationConnector(inputLayer, hiddenLayer).Initializer = new RandomFunction(-0.5, 0.5);
            new BackpropagationConnector(hiddenLayer, outputLayer).Initializer = new RandomFunction(-0.5, 0.5);

            this.network = new BackpropagationNetwork(inputLayer, outputLayer);

            this.network.SetLearningRate(0.2);
            this.network.Initialize();

            #region Initialize_parameters

            this.name = agentName;
            this.id = Int32.Parse(agentName.Last().ToString());

            this.agentType = type;
            this.policyFrozen = policy;

            if (policy)
            {
                this.epsilon = 0;
                this.alpha = 0;
            }
            else
            {
                this.epsilon = 0.5;
                this.alpha = 0.2;
            }

            this.gamma = 0.95;
            this.lamda = 0.8;

            currentEpoch = 1;

            initParams();

            #endregion Initialize_parameters
        }