public KohonenInfoViewModel(models.Task task, models.TaskSolver solver)
        {
            this.task  = task;
            taskSolver = solver;

            KohonenNNTopology t = solver.Description as KohonenNNTopology;

            Inputs           = Convert.ToInt32(t.GetInputsCount());
            Outputs          = Convert.ToInt32(t.GetOutputsCount());
            Width            = t.GetLayerWidth();
            Height           = t.GetLayerHeight();
            Metric           = t.GetMetric();
            ClassInitializer = t.GetClassInitializer();
            ClassEps         = t.GetClassEps();
            Name             = solver.Name;
            TaskName         = task.Name;
            TileGraphs       = new ObservableCollection <TileGraphViewModel>();
            SizeOfTile       = 10;
            paramNames       = new string[] { };
            data             = new List <Tuple <int2d, double> >[] { };

            addHandler = new ActionHandler(
                () =>
            {
                TileGraphs.Add(new TileGraphViewModel(Width, Height, SizeOfTile)
                {
                    DeleteCallback = DeleteGraph,
                    ParameterNames = paramNames,
                    Data           = data
                });
            },
                (e) => true);
        }
Beispiel #2
0
 public ArchiveTaskSolver(models.TaskSolver solv)
 {
     this.ID          = solv.ID;
     this.Name        = solv.Name;
     this.TypeName    = solv.TypeName;
     this.Description = solv.Description;
 }
Beispiel #3
0
        public PerceptronInfoViewModel(models.Task task, models.TaskSolver solver)
        {
            TaskName = task.Name;
            Name     = solver.Name;

            PerceptronTopology topology = solver.Description as PerceptronTopology;

            Layers = new Layer[topology.GetLayersCount() - 1];
            var neurons = topology.GetNeuronsInLayersCount();
            var delays  = topology.HasLayersDelayWeight();
            var afs     = topology.GetActivationFunctionsNames();

            CountInputNeurons = Convert.ToInt32(topology.GetInputsCount());
            for (int i = 0; i < Layers.Length - 1; i++)
            {
                Layers[i] = new Layer
                {
                    Name             = String.Format("{0} слой", i + 1),
                    ActivateFunction = afs[i],
                    NeuronsCount     = neurons[i + 1],
                    HasW0            = delays[i]
                };
            }
            Layers[Layers.Length - 1] = new Layer
            {
                Name             = "Выходной слой",
                ActivateFunction = afs[Layers.Length - 1],
                NeuronsCount     = neurons[Layers.Length],
                HasW0            = delays[Layers.Length - 1]
            };
        }
        public DecisionTreeC4_5InfoViewModel(models.Task task, models.TaskSolver solver)
        {
            TaskName = task.Name;
            Name     = solver.Name;

            TreeDescriptionC4_5 td = solver.Description as TreeDescriptionC4_5;

            MaxTreeDepth = td.MaxDepth;
        }
Beispiel #5
0
        public SolveViewModel(models.Task task, models.TaskSolver solver)
        {
            TaskID      = task.ID;
            SolvingList = new ObservableCollection <SolvingInstance>();
            SolverName  = solver.Name;
            TaskName    = task.Name;
            List <LearningInfo>         learningList   = new List <LearningInfo>();
            List <models.LearnedSolver> learnedSolvers = models.LearnedSolver.learnedSolversOfTaskSolverID(solver.ID);

            foreach (models.LearnedSolver learnedSolver in learnedSolvers)
            {
                models.Selection selection = (models.Selection)models.Selection.getById(learnedSolver.SelectionID, typeof(models.Selection));
                List <models.LearningQuality> qualities  = models.LearningQuality.qualitiesOfSolverId(learnedSolver.ID);
                models.LearningScenario       scenario   = (models.LearningScenario)models.LearningScenario.getById(learnedSolver.LearningScenarioID, typeof(models.LearningScenario));
                models.TaskTemplate           template   = (models.TaskTemplate)models.TaskTemplate.getById(selection.TaskTemplateID, typeof(models.TaskTemplate));
                models.LearningQuality        quality    = (qualities != null && qualities.Count > 0) ? qualities[0] : null;
                List <models.Parameter>       parameters = models.Parameter.parametersOfTaskTemplateId(template.ID);
                int outputParam = 0;
                foreach (models.Parameter param in parameters)
                {
                    if (param.IsOutput == 1)
                    {
                        outputParam = param.ID;
                        break;
                    }
                }
                learningList.Add(new LearningInfo
                {
                    SelectionID          = selection.ID,
                    ParameterID          = outputParam,
                    SelectionName        = selection.Name,
                    LearningScenarioName = scenario.Name,
                    PreprocessingName    = template.Name,
                    TestMistake          = (quality != null) ? quality.MistakeTest : 0,
                    TrainMistake         = (quality != null) ? quality.MistakeTrain : 0,
                    ClosingError         = Convert.ToSingle((quality != null) ? quality.ClosingError : 0),
                    TaskTemplate         = template,
                    LearnedSolver        = learnedSolver
                });
            }
            LearningList = learningList.ToArray();
            addHandler   = new ActionHandler(() =>
            {
                SolvingList.Add(new SolvingInstance(this, this.SelectedLearning.TaskTemplate));
                solveHandler.RaiseCanExecuteChanged();
                saveHandler.RaiseCanExecuteChanged();
                SelectedSolution = Solutions[0];
                NotifyPropertyChanged("SelectedSolution");
                NotifyPropertyChanged("Solutions");
            }, e => SelectedLearning != null);

            solveHandler = new ActionHandler(Solve, e => SolvingList.Count > 0);
            saveHandler  = new ActionHandler(saveSolutions, e => SolvingList.Count > 0);

            SelectedSolution = Solutions[0];
        }
Beispiel #6
0
 public SolverLeaf(models.Task task, models.TaskSolver solver, string solverType,
                   TaskTreeViewModel vm) : base(solver.Name)
 {
     parentTask             = task;
     this.solverType        = solverType;
     this.solver            = solver;
     showSolverInfoHandler  = new ActionHandler(() => vm.SendRequestCreateView(CreateSolverInfoViewModel()), e => true);
     showSolveDialogHandler = new ActionHandler(() => vm.SendRequestCreateView(new SolveViewModel(parentTask, solver)), e => true);
     showLearnDialogHandler = new ActionHandler(() => vm.SendRequestCreateView(new LearnSolverViewModel(parentTask, solver)), e => true);
 }
        public ConvNNInfoViewModel(models.Task task, models.TaskSolver solver)
        {
            TaskName = task.Name;
            Name     = solver.Name;

            var t = solver.Description as ConvNNTopology;

            InputDimention = String.Format("{0}x{1}x{2}", t.GetInputWidth(), t.GetInputHeigth(), t.GetInputDepth());

            ilayers = t.GetLayers().ToArray();
            var volumes = t.GetVolumeDimentions();

            Layers = new ConvNNLayer[ilayers.Length];
            for (int i = 0; i < ilayers.Length; i++)
            {
                if (ilayers[i] is FullyConnectedLayer)
                {
                    Layers[i] = new ConvNNLayer
                    {
                        Number = i + 1,
                        Type   = "FC",
                        Width  = volumes[i].Width,
                        Height = volumes[i].Heigth,
                        Depth  = volumes[i].Depth
                    };
                }
                else if (ilayers[i] is ConvolutionLayer)
                {
                    Layers[i] = new ConvNNLayer
                    {
                        Number = i + 1,
                        Type   = "Conv",
                        Width  = volumes[i].Width,
                        Height = volumes[i].Heigth,
                        Depth  = volumes[i].Depth
                    };
                }
                else if (ilayers[i] is PoolingLayer)
                {
                    Layers[i] = new ConvNNLayer
                    {
                        Number = i + 1,
                        Type   = "Pool",
                        Width  = volumes[i].Width,
                        Height = volumes[i].Heigth,
                        Depth  = volumes[i].Depth
                    };
                }
            }
        }
        public WardNetInfoViewModel(models.Task task, models.TaskSolver solver)
        {
            TaskName = task.Name;
            Name     = solver.Name;

            WardNNTopology t           = solver.Description as WardNNTopology;
            var            input_layer = t.GetInputLayer();
            var            layers      = t.GetLayers();

            int gsize  = 0;
            int adsize = (input_layer.ForwardConnection > 0) ? 1 : 0;

            for (int i = 0; i < layers.Count; i++)
            {
                gsize += layers[i].Groups.Count;
                if (layers[i].ForwardConnection > 0)
                {
                    adsize++;
                }
            }

            CountInputNeurons = input_layer.NeuronsCount;
            Groups            = new WardNetGroup[gsize];
            AdditionalConns   = new AdditionalConnection[adsize];

            int gindex           = 0;
            int last_layer_index = layers.Count - 1;

            for (int i = 0; i < last_layer_index; i++)
            {
                for (int j = 0; j < layers[i].Groups.Count; j++)
                {
                    Groups[gindex++] = new WardNetGroup
                    {
                        LayerName        = String.Format("{0} слой", i + 1),
                        GroupName        = String.Format("{0} группа", j + 1),
                        NeuronsCount     = layers[i].Groups[j].NeuronsCount,
                        ActivateFunction = layers[i].Groups[j].ActivationFunction,
                        HasW0            = layers[i].Groups[j].HasDelay
                    };
                }
            }

            for (int j = 0; j < layers[last_layer_index].Groups.Count; j++)
            {
                Groups[gindex++] = new WardNetGroup
                {
                    LayerName        = "Выходной слой",
                    GroupName        = String.Format("{0} группа", j + 1),
                    NeuronsCount     = layers[last_layer_index].Groups[j].NeuronsCount,
                    ActivateFunction = layers[last_layer_index].Groups[j].ActivationFunction,
                    HasW0            = layers[last_layer_index].Groups[j].HasDelay
                };
            }

            int adindex = 0;

            if (input_layer.ForwardConnection > 0)
            {
                AdditionalConns[adindex++] = new AdditionalConnection
                {
                    Start = String.Format("Входной слой"),
                    End   = String.Format("{0} слой", input_layer.ForwardConnection + 1)
                };
            }
            for (int i = 0; i < layers.Count; i++)
            {
                if (layers[i].ForwardConnection > 0)
                {
                    AdditionalConns[adindex++] = new AdditionalConnection
                    {
                        Start = String.Format("{0} слой", i + 1),
                        End   = String.Format("{0} слой", i + 1 + layers[i].ForwardConnection + 1)
                    };
                }
            }
        }