Пример #1
0
        public void SaveMemoryToDB(Guid layerId, Guid userId, int number, DBInserter dbInserter)
        {
            // Saving networks info:
            dbInserter.InsertNeuron(Id, userId, layerId, number, _offsetValue, _offsetWeight);

            // Saving weights info:
            for (int i = 0; i < _weights.Length; i++)
            {
                dbInserter.InsertWeight(Id, userId, i, _weights[i]);
            }
        }
Пример #2
0
        public void SaveMemoryToDB(Guid networkId, Guid userId, int number, DBInserter dbInserter)
        {
            // Saving layer info:
            dbInserter.InsertLayer(Id, userId, networkId, number);

            // Saving neurons info:
            for (int i = 0; i < _neuronList.Count; i++)
            {
                _neuronList[i].SaveMemoryToDB(Id, userId, i, dbInserter);
            }
        }
Пример #3
0
        public void SaveMemoryToDB(Guid networkId, Guid userId, int number, DBInserter dbInserter)
        {
            // Saving layer info:
            dbInserter.InsertLayer(Id, userId, networkId, number);

            // Saving neurons info:
            int foreachIndex = 0;

            foreach (Neuron neuron in _neuronList)
            {
                neuron.SaveMemoryToDB(Id, userId, foreachIndex, dbInserter);
                foreachIndex++;
            }
        }
Пример #4
0
        private void SavingMemoryToDB(DatabaseConfig dbConfig, string networkStructure, Guid userId)
        {
            try
            {
                DBInserter dbInserter = new DBInserter(dbConfig);

                // Saving networks info:
                _net.SaveMemoryToDB(Iteration, networkStructure, userId, dbInserter);
                Console.WriteLine("Networks memory backuped to database successfully!");
            }
            catch (Exception ex)
            {
                Logger.LogError(ErrorType.DBInsertError, "Save memory to database error!\n" + ex);
                Console.WriteLine($" {DateTime.Now} Save memory to database error!\n {ex}");
            }
        }
Пример #5
0
        public void SaveMemoryToDB(int iterations, string networkStructure, Guid userId, DBInserter dbInserter)
        {
            // Saving network info:
            dbInserter.InsertNetwork(Id, userId, iterations, networkStructure);

            // Saving layers info:
            for (int i = 0; i < _layerList.Count; i++)
            {
                _layerList[i].SaveMemoryToDB(Id, userId, i, dbInserter);
            }
        }
Пример #6
0
        public void SaveMemoryToDB(int iterations, string networkStructure, Guid userId, DBInserter dbInserter)
        {
            // Saving network info:
            dbInserter.InsertNetwork(Id, userId, iterations, networkStructure);

            // Saving layers info:
            int foreachIndex = 0;

            foreach (Layer layer in _layerList)
            {
                layer.SaveMemoryToDB(Id, userId, foreachIndex, dbInserter);
                foreachIndex++;
            }
        }