示例#1
0
        /// <summary>
        /// Create a new trainer and use it to run a training cycle using the current 'stage' = RNN or RL.
        /// </summary>
        /// <param name="mycaffe">Specifies the MyCaffeControl to use.</param>
        /// <param name="nIterationOverride">Specifies the iterations to run if greater than zero.</param>
        /// <param name="type">Specifies the type of iterator to use.</param>
        /// <param name="step">Optionally, specifies whether or not to step the training for debugging (default = NONE).</param>
        public void Train(Component mycaffe, int nIterationOverride, ITERATOR_TYPE type = ITERATOR_TYPE.ITERATION, TRAIN_STEP step = TRAIN_STEP.NONE)
        {
            if (m_itrainer == null)
            {
                m_itrainer = createTrainer(mycaffe, getStage());
            }

            if (nIterationOverride == -1)
            {
                nIterationOverride = m_nIterations;
            }

            m_itrainer.Train(nIterationOverride, type, step);
            cleanup(1000, false);
        }
示例#2
0
        /// <summary>
        /// Create a new trainer and use it to run a training cycle using the current 'stage' = RNN or RL.
        /// </summary>
        /// <param name="mycaffe">Specifies the MyCaffeControl to use.</param>
        /// <param name="nIterationOverride">Specifies the iterations to run if greater than zero.</param>
        /// <param name="step">Optionally, specifies whether or not to step the training for debugging (default = NONE).</param>
        public void Train(Component mycaffe, int nIterationOverride, TRAIN_STEP step = TRAIN_STEP.NONE)
        {
            if (m_itrainer == null)
            {
                m_itrainer = createTrainer(mycaffe, getStage());
            }

            if (nIterationOverride == -1)
            {
                nIterationOverride = m_nIterations;
            }

            m_itrainer.Train(nIterationOverride, step);
            m_itrainer.Shutdown(1000);
            m_itrainer = null;
        }