Exemplo n.º 1
0
        private void LoadRpmDataButton_Click(object sender, RoutedEventArgs e)
        {
            LoadIdxDataWindow ldw = new LoadIdxDataWindow {
                Title = "Load RPM audio data"
            };

            if (ldw.ShowDialog().GetValueOrDefault())
            {
                LoadIdxDataWindowModel dc = ldw.DataContext as LoadIdxDataWindowModel;
                dataContainer = new AudioRpmDataContainer();
                LoadData(dc.TrainingData, dc.TrainingLabels, dc.TestingData, dc.TestingLabels);
                model.TrainerType = "RPM trainer";
            }
        }
Exemplo n.º 2
0
        private void LoadGenericIdxDataButton_Click(object sender, RoutedEventArgs e)
        {
            LoadIdxDataWindow ldw = new LoadIdxDataWindow {
                Title = "Load generic IDX data"
            };

            if (ldw.ShowDialog().GetValueOrDefault())
            {
                LoadIdxDataWindowModel dc = ldw.DataContext as LoadIdxDataWindowModel;
                IdxReader dataReader      = new IdxReader(dc.TestingData);
                IdxReader labelReader     = new IdxReader(dc.TestingLabels);
                Type      dataType        = GetTypeFromIdxType(dataReader.DataType);
                Type      labelType       = GetTypeFromIdxType(labelReader.DataType);
                Type      containerType   = typeof(LabeledDataContainer <,>).MakeGenericType(dataType, labelType);
                dataContainer = Activator.CreateInstance(containerType) as ILabeledDataContainer;
                LoadData(dc.TrainingData, dc.TrainingLabels, dc.TestingData, dc.TestingLabels);
                model.TrainerType = "Generic trainer";
            }
        }