Exemplo n.º 1
0
        public static async Task <ITestDataset> GetTestDatasetAsync(
            [CanBeNull] Action <TrainingProgressEventArgs> progress = null, Cifar100ClassificationMode mode = Cifar100ClassificationMode.Fine,
            [CanBeNull] IProgress <HttpProgress> callback           = null, CancellationToken token = default)
        {
            IReadOnlyDictionary <String, Func <Stream> > map = await DatasetsDownloader.GetArchiveAsync(DatasetURL, callback, token);

            if (map == null)
            {
                return(null);
            }
            IReadOnlyList <(float[], float[])> data = ParseSamples(map[TestBinFilename], TestSamplesInBinFile, mode);

            return(DatasetLoader.Test(data, progress));
        }
Exemplo n.º 2
0
        public static async Task <ITrainingDataset> GetTrainingDatasetAsync(int size, Cifar100ClassificationMode mode = Cifar100ClassificationMode.Fine, CancellationToken token = default)
        {
            IReadOnlyDictionary <String, Func <Stream> > map = await DatasetsDownloader.GetArchiveAsync(DatasetURL, token);

            if (map == null)
            {
                return(null);
            }
            IReadOnlyList <(float[], float[])>[] data = new IReadOnlyList <(float[], float[])> [TrainingBinFilenames.Count];