private void OnBtnTrainClick(object sender, RoutedEventArgs e) { _lattice = new Lattice(_dataContext.Width, _dataContext.Height, INPUT_DIMENSION, _dataContext.NumberOfIterations, _dataContext.LearningRate); _dataContext.ProgressBar = 0; _dataContext.Stopwatch = Stopwatch.StartNew(); _dispatcherTimer.Start(); var input = _dataContext.OriginalImage.ToVectors().ToArray(); _backgroundWorker.RunWorkerAsync(input); }
public MainWindow() { InitializeComponent(); _dataContext = new ImageSomCompressorDataContext(); DataContext = _dataContext; _lattice = new Lattice(3, 3, INPUT_DIMENSION, 100, 0.5); _backgroundWorker = new BackgroundWorker { WorkerReportsProgress = true, WorkerSupportsCancellation = true }; _backgroundWorker.DoWork += OnBackgroundWorker_DoWork; _backgroundWorker.ProgressChanged += OnBackgroundWorker_ProgressChanged; _backgroundWorker.RunWorkerCompleted += OnBackgroundWorker_ProgressChanged_Complete; _dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1); _dispatcherTimer.Tick += OnDispatcherTimer_Tick; }
public ILattice <AEDomain> Join(ILattice <AEDomain> right) => new AELattice(Domain.Intersect(right.GetDomain()).ToDomain());
public bool PartialOrder(ILattice <AEDomain> right) => Domain.IsSupersetOf(right.GetDomain());