public void AddModel(NetModelBase paModel, DataSetModel paTrainingDataSet, GpuCard paGpuCard) { var model = new TrainingModel(paModel, paTrainingDataSet, paGpuCard); model.PropertyChanged += ModelOnPropertyChanged; TrainingModels.Add(model); }
private TModel ParseModel <TModel>(string paJson) where TModel : NetModelBase { try { return(NetModelBase.FromJsonToInstance <TModel>(paJson)); } catch (Exception e) { Debug.WriteLine(e); return(default(TModel)); } }
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)); } }
public bool CanExecute(object parameter) { return((NetModelBase = parameter as NetModelBase) != null); }