Ejemplo n.º 1
0
        private void SaveCurrentNetworkValuesToFile()
        {
            var saveFileDialog = new SaveFileDialog
            {
                InitialDirectory = saveNetworkFolder,
                Title            = @"Save neural network layout",
                Filter           = @"Json files (*.json)|*.json|All files (*.*)|*.*",
                AddExtension     = true,
            };

            DialogResult result = saveFileDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                string json = new NetworkJsonConverter().Serialize(network);

                File.WriteAllText(saveFileDialog.FileName, json);
            }
        }
Ejemplo n.º 2
0
        public void SaveNeuralNetwork(INeuralNetwork network, string path)
        {
            var content = new NetworkJsonConverter().Serialize((network as NeuraNet).Network);

            File.WriteAllText(path, content);
        }