Ejemplo n.º 1
0
        protected void OnMouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                choosedinputNeuron = null;
                choosedNeuron      = null;

                net.SetSelection(net.GetNeuronsByRectangle(currentRect));
                selectionRectangle = false;
                currentRect        = new Rectangle();
                Refresh();
            }

            mStatus.UpEvent(e);
        }
Ejemplo n.º 2
0
        protected void OnMouseDown(object sender, MouseEventArgs e)
        {
            mStatus.DownEvent(e);
            ((Control)sender).Focus();

            if (e.Button == MouseButtons.Left)
            {
                if ((choosedinputNeuron = GetinputByPosition(e.Location)) == null)
                {
                    choosedNeuron = GetNeuronByPosition(e.Location);
                }

                currentRect.Location = new Point(e.X, e.Y);
                selectionRectangle   = true;
            }
        }
Ejemplo n.º 3
0
 protected void OnMouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if ((choosedinputNeuron = GetinputByPosition(e.Location)) != null)
         {
             NeuroninputInformation dlg = new NeuroninputInformation(choosedinputNeuron);
             dlg.ShowDialog();
             Refresh();
         }
         else if ((choosedNeuron = GetNeuronByPosition(e.Location)) != null)
         {
             NeuronInformation dlg = new NeuronInformation(choosedNeuron);
             dlg.ShowDialog();
         }
     }
 }
Ejemplo n.º 4
0
 public NeuroninputInformation(NeuronInput ninput)
 {
     InitializeComponent();
     neuroninput         = ninput;
     inputValueText.Text = neuroninput.value.ToString("0.00");
 }
Ejemplo n.º 5
0
 public Sinaps(NeuronInput input)
 {
     frominput = input;
     value     = ((float)rand.Next(interval.X, interval.Y)) / multiplier;
     //  value = 0.2f;
 }
Ejemplo n.º 6
0
 public Sinaps(NeuronInput input, Neuron neuron)
 {
     fromNeuron = neuron;
     frominput  = input;
     value      = ((float)rand.Next(interval.X, interval.Y)) / multiplier;
 }
Ejemplo n.º 7
0
        private NeuronNet AcceptJson(Root2 root2)
        {
            NeuronNet net = new NeuronNet();

            for (int i = 0; i < root2.inputss.Count; i++)
            {
                PointF pointF = new PointF();
                pointF.X = (float)root2.inputss[i].Position.X;
                pointF.Y = (float)root2.inputss[i].Position.Y;
                NeuronInput neuron = new NeuronInput((float)root2.inputss[i].value, root2.inputss[i].Name, pointF);
                neuron.positionChanged = root2.inputss[i].positionChanged;
                neuron.wasPainted      = root2.inputss[i].wasPainted;
                net.inputss.Add(neuron);
            }
            for (int i = 0; i < root2.NeuronGroups.Count; i++)
            {
                NeuronGroup neurongroup = new NeuronGroup();
                neurongroup.Neurons              = root2.NeuronGroups[i].Neurons;
                neurongroup.SecondActivate       = root2.NeuronGroups[i].SecondActivate;
                neurongroup.SumForSoftMax        = (float)root2.NeuronGroups[i].SumForSoftMax;
                neurongroup.allNeuronsWasPainted = root2.NeuronGroups[i].allNeuronsWasPainted;
                net.NeuronGroups.Add(neurongroup);
            }
            for (int i = 0; i < root2.studyPairss.Count; i++)
            {
                StudyPair studyPair = new StudyPair();
                for (int j = 0; j < root2.studyPairss[i].inputs.Count; j++)
                {
                    studyPair.inputs.Add((float)root2.studyPairss[i].inputs[j]);
                }
                for (int j = 0; j < root2.studyPairss[i].quits.Count; j++)
                {
                    studyPair.quits.Add((float)root2.studyPairss[i].quits[j]);
                }
                for (int j = 0; j < root2.studyPairss[i].realQuits.Count; j++)
                {
                    studyPair.realQuits.Add((float)root2.studyPairss[i].realQuits[j]);
                }
                net.studyPairss.Add(studyPair);
            }
            net.E      = (float)root2.E;
            net.moment = (float)root2.moment;
            for (int i = 0; i < root2.errors.Count; i++)
            {
                PointF pointF = new PointF();
                pointF.X = (float)root2.errors[i].X;
                pointF.Y = (float)root2.errors[i].Y;
                net.errors.Add(pointF);
            }
            for (int i = 0; i < root2.normalizedErrors.Count; i++)
            {
                PointF pointF = new PointF();
                pointF.X = (float)root2.normalizedErrors[i].X;
                pointF.Y = (float)root2.normalizedErrors[i].Y;
                net.normalizedErrors.Add(pointF);
            }
            net.EraCount             = root2.EraCount;
            net.currentSelection     = new NeuronGroup(0);
            net.recognitionResults   = new List <RecognitionResult>();
            net.StudyPairsLoaded     = root2.StudyPairsLoaded;
            net.InputsSum            = (float)root2.InputsSum;
            net.allInputsWasPainted  = root2.allInputsWasPainted;
            net.minError             = (float)root2.minError;
            net.NormalizeOutputValue = (float)root2.NormalizeOutputValue;
            net.biasX           = (float[])root2.biasX;
            net.biasY           = (float[])root2.biasY;
            net.scaleX          = (float[])root2.scaleX;
            net.scaleY          = (float[])root2.scaleY;
            net.StudyLimit      = (float)root2.StudyLimit;
            net.AccessChangeNet = root2.AccessChangeNet;
            return(net);
        }