private void ReadPesosEntradas(OpenFileDialog openFileDialog)
        {
            dtgPesosEntrada.Rows.Clear();
            inputWeights.pesosEntrada.Clear();
            string linea = string.Empty;

            string[]     Datos  = new string[10];
            FileStream   file   = new FileStream(openFileDialog.FileName, FileMode.OpenOrCreate, FileAccess.Read);
            StreamReader reader = new StreamReader(file);

            while ((linea = reader.ReadLine()) != null)
            {
                InputWeights pesosUnicapa = new InputWeights();
                char         delimiter    = ';';
                Datos = linea.Split(delimiter);

                dtgPesosEntrada.ColumnCount = Datos.Length;

                for (int i = 0; i < Datos.Length; i++)
                {
                    pesosUnicapa.pesosEntrada.Add(Convert.ToDouble(Datos[i]));
                    dtgPesosEntrada.Columns[i].HeaderText = "W" + i;
                    dtgPesosEntrada.Columns[i].Width      = 45;
                    inputWeights.pesosEntrada.Add(Convert.ToDouble(Datos[i]));
                }

                dtgPesosEntrada.Rows.Add(Datos);
            }

            reader.Close();
            file.Close();
        }
Exemple #2
0
        public override XElement ToXElement(string name)
        {
            var element = base.ToXElement(name);

            element.Add(InputWeights.ToXElement("inputWeights"));
            element.Add(OutputWeights.ToXElement("outputWeights"));
            return(element);
        }
 public Index()
 {
     InitializeComponent();
     inputDataService   = new InputData();
     inputs             = new List <Input>();
     inputWeights       = new InputWeights();
     ErroresPatrones    = new List <double>();
     PesosIdeales       = new InputWeights();
     DatosSimular       = new Input();
     ErroresIteraciones = new List <double>();
     SalidasYDS         = new List <double>();
     SalidasYRS         = new List <double>();
 }
 private void Limpiar()
 {
     dtgEntradas.Rows.Clear(); dtgEntradas.Columns.Clear(); dtg_eit_vs_it.Rows.Clear();
     dtgPesosEntrada.Rows.Clear(); dtgPesosEntrada.Columns.Clear();
     txtUmbral.Text               = ""; txtValorUmbral.Text = ""; txtUmbralObtenido.Text = "";
     txtRataAprendizaje.Text      = ""; txtValorRataAprendizaje.Text = "";
     txtErrorLineal.Text          = ""; txtErrorMaximoPermitido.Text = ""; txtErrorPatron.Text = "";
     txtFuncionActivacion.Text    = ""; txtNumEntradas.Text = ""; txtNumeroIteraciones.Text = "";
     txtVallorErrorPermitido.Text = "";
     txtAgregarSimulacion.Text    = ""; txtSimulacion.Text = ""; txtValorSoma.Text = "";
     txtSalidaYR.Text             = ""; txtSalidaYR.Text = ""; txtNumPesosEntrada.Text = "";
     txtNumeroIteCumplidas.Text   = ""; txtNumPatrones.Text = "";
     inputs = null; inputWeights = null; ErroresPatrones = null;
     txtValorNumeroIteraciones.Text = "";
     inputDataService = null;
     chartERIvsITE.Series.Clear();
 }