Пример #1
0
        public void AddModel(NetModelBase paModel, DataSetModel paTrainingDataSet, GpuCard paGpuCard)
        {
            var model = new TrainingModel(paModel, paTrainingDataSet, paGpuCard);

            model.PropertyChanged += ModelOnPropertyChanged;
            TrainingModels.Add(model);
        }
Пример #2
0
 private TModel ParseModel <TModel>(string paJson) where TModel : NetModelBase
 {
     try
     {
         return(NetModelBase.FromJsonToInstance <TModel>(paJson));
     }
     catch (Exception e)
     {
         Debug.WriteLine(e);
         return(default(TModel));
     }
 }
Пример #3
0
 private TrainedNetModel ParseTrainedModel(string paJson)
 {
     try
     {
         var model = NetModelBase.FromJsonToInstance <TrainedNetModel>(paJson);
         if (model?.DataSetMetaData?.ClassLabels?.Any() != true)
         {
             NotifyUser.NotifyUserByNotification(new Notification()
             {
                 Title   = "Invalid model",
                 Message = "This model doesn't seems to have valid dataset metadata. Please make sure this file is not corrupted."
             });
             return(null);
         }
         return(model);
     }
     catch (Exception e)
     {
         NotifyUser.NotifyUserByMessage("Something bad happend during model loading.", e);
         Debug.WriteLine(e);
         return(default(TrainedNetModel));
     }
 }
Пример #4
0
 public bool CanExecute(object parameter)
 {
     return((NetModelBase = parameter as NetModelBase) != null);
 }