Beispiel #1
0
                public bool DoIter(double[][,] input, double[] expected)
                {
                    if (m_IsBusy)
                    {
                        return(false);
                    }

                    lock (m_Sync)
                    {
                        if (m_IsBusy)
                        {
                            return(false);
                        }
                        m_IsBusy = true;
                    }

                    try
                    {
                        m_Algorithm.runIteration(m_Values, m_Errors, m_GradientPortion, input, expected);
                    }
                    finally
                    {
                        m_IsBusy = false;
                    }
                    return(true);
                }
Beispiel #2
0
                public bool DoIter(double[][,] input, Class cls)
                {
                    if (m_IsBusy)
                    {
                        return(false);
                    }

                    lock (m_Sync)
                    {
                        if (m_IsBusy)
                        {
                            return(false);
                        }
                        m_IsBusy = true;
                    }

                    try
                    {
                        //lock (m_Algorithm) System.Threading.Thread.Sleep(3000);

                        m_Algorithm.runIteration(m_Values, m_Errors, m_GradientPortion, input, cls);
                    }
                    finally
                    {
                        m_IsBusy = false;
                    }
                    return(true);
                }