/// <summary>
        /// Releases all resources used by the InernalThread.
        /// </summary>
        /// <param name="bDisposing">Set to <i>true</i> when called from Dispose().</param>
        protected virtual void Dispose(bool bDisposing)
        {
            if (m_evtCancel != null)
            {
                m_evtCancel.Set();
            }

            StopInternalThread();

            if (m_evtCancel != null)
            {
                m_evtCancel.Dispose();
                m_evtCancel = null;
            }
        }
Esempio n. 2
0
        private void Solver_OnTrainingIteration(object sender, TrainingIterationArgs <T> e)
        {
            m_log.WriteLine("Iteration = " + e.Iteration.ToString() + " - Loss = " + e.SmoothedLoss.ToString());

            if (double.IsNaN(e.Loss))
            {
                m_log.WriteError(new Exception("Loss = NAN!"));
                m_evtCancel.Set();
                return;
            }

            if (double.IsInfinity(e.Loss))
            {
                m_log.WriteError(new Exception("Loss = Infinity!"));
                m_evtCancel.Set();
                return;
            }
        }
Esempio n. 3
0
        void log_OnWriteLine(object sender, LogArg e)
        {
            if (m_iprogress != null)
            {
                CreateProgressArgs arg = new CreateProgressArgs(e.Progress, e.Message);
                m_iprogress.OnProgress(arg);

                if (arg.Abort)
                {
                    m_evtCancel.Set();
                }
            }
        }
Esempio n. 4
0
 private void abortToolStripMenuItem_Click(object sender, EventArgs e)
 {
     abortToolStripMenuItem.Enabled = false;
     m_evtCaffeCancel.Set();
     m_evtCancel.Set();
 }
Esempio n. 5
0
 private void exitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     m_evtCancel.Set();
     m_evtThreadDone.WaitOne();
     Close();
 }
Esempio n. 6
0
 /// <summary>
 /// Shutdown the data queries and consolidation thread.
 /// </summary>
 public void Shutdown()
 {
     m_evtCancel.Set();
     m_iquery.Close();
 }
Esempio n. 7
0
 public static void Stop()
 {
     CancelEvent.Set();
 }
Esempio n. 8
0
 /// <summary>
 /// Shutdown the data queries and consolidation thread.
 /// </summary>
 public void Shutdown()
 {
     m_evtCancel.Set();
     m_colDataQuery.Shutdown();
     m_colData.Cancel.Set();
 }
Esempio n. 9
0
 /// <summary>
 /// Stop training or running.
 /// </summary>
 /// <param name="sender">Specifies the sender</param>
 /// <param name="e">specifies the arguments.</param>
 private void btnStop_Click(object sender, EventArgs e)
 {
     m_evtCancel.Set();
     m_bw.CancelAsync();
     m_bStopping = true;
 }
Esempio n. 10
0
 /// <summary>
 /// Stop the internal query thread.
 /// </summary>
 public void Shutdown()
 {
     m_evtCancel.Set();
 }