Exemplo n.º 1
0
        public static String LoadNetwork(String name)
        {
            if (isTraining)
            {
                return("You can't load a network when there already is one training.");
            }

            String networkId = GoogleDriveHandler.GetFileIdByName(name + "-nn");

            if (String.IsNullOrEmpty(networkId))
            {
                return(String.Format("No file found with the name {0}-nn.", name));
            }

            String networkContent = GoogleDriveHandler.DownloadGoogleDocument(networkId, "text/plain", Encoding.UTF8);

            network      = ModelFileHandler.LoadModelFromString(networkContent);
            network.Name = name;

            return("Network successfully loaded in.");
        }
Exemplo n.º 2
0
        public static String LoadDataSet(String name)
        {
            if (NeuralNetworkHandler.isTraining)
            {
                return("You can't load a dataset when there is a network training.");
            }


            String datasetId = GoogleDriveHandler.GetFileIdByName(name + "-ds");

            if (datasetId == null)
            {
                return(String.Format("No file found with the name {0}-ds", name));
            }

            String datasetContent = GoogleDriveHandler.DownloadGoogleDocument(datasetId, "text/plain", Encoding.UTF8);

            NeuralNetworkHandler.keeper = JsonConvert.DeserializeObject <DataKeeper>(datasetContent);
            NeuralNetworkHandler.keeper.ValidationSet = NeuralNetworkHandler.keeper.DataSet;
            NeuralNetworkHandler.keeper.ShuffleDataSet();

            return("Dataset successfully loaded in.");
        }