コード例 #1
0
 public void Run(string strTestDllFile, bool bResetAllTests, int nGpuId = 0, IMGDB_VERSION imgDbVer = IMGDB_VERSION.DEFAULT, string strCudaPath = "")
 {
     m_evtCancel.Reset();
     m_evtGlobalCancel.Reset();
     m_fiPath = new FileInfo(strTestDllFile);
     m_bw.RunWorkerAsync(new AutoTestParams(strTestDllFile, bResetAllTests, nGpuId, imgDbVer, strCudaPath));
 }
コード例 #2
0
 public FormAutomatedTests(string strPath, int nGpuID, IMGDB_VERSION imgDbVer, string strCudaPath)
 {
     m_strPath     = strPath;
     m_nGpuID      = nGpuID;
     m_imgDbVer    = imgDbVer;
     m_strCudaPath = strCudaPath;
     InitializeComponent();
 }
コード例 #3
0
 public AutoTestParams(string strTestDllFile, bool bResetAllTests, int nGpuId = 0, IMGDB_VERSION imgDbVer = IMGDB_VERSION.DEFAULT, string strCudaPath = "")
 {
     m_strTestDllFile = strTestDllFile;
     m_bResetAllTests = bResetAllTests;
     m_nGpuId         = nGpuId;
     m_imgDbVer       = imgDbVer;
     m_strCudaPath    = strCudaPath;
 }
コード例 #4
0
ファイル: SettingsCaffe.cs プロジェクト: alllucky1996/MyCaffe
 /// <summary>
 /// The SettingsCaffe constructor used during deserialization.
 /// </summary>
 /// <param name="info">Specifies the serialization information.</param>
 /// <param name="context">Specifies the serialization context.</param>
 public SettingsCaffe(SerializationInfo info, StreamingContext context)
 {
     m_imgDbVersion                 = (IMGDB_VERSION)getInt(info, "ImageDbVersion", (int)m_imgDbVersion);
     m_bEnableLabelBalancing        = getBool(info, "bEnableLabelBalancing", m_bEnableLabelBalancing);
     m_bEnableLabelBoosting         = getBool(info, "bEnableLabelBoosting", m_bEnableLabelBoosting);
     m_bEnableRandomInputSelection  = getBool(info, "bEnableRandomInputSelection", m_bEnableRandomInputSelection);
     m_bEnablePairInputSelection    = getBool(info, "bEnablePairInputSelection", m_bEnablePairInputSelection);
     m_bUseTrainingSourceForTesting = getBool(info, "bUseTrainingSourceForTesting", m_bUseTrainingSourceForTesting);
     m_dfSuperBoostProbability      = getDouble(info, "dfSuperBoostProbability", m_dfSuperBoostProbability);
     m_nMaximumIterationOverride    = getInt(info, "nMaximumIterationOverride", m_nMaximumIterationOverride);
     m_nTestingIterationOverride    = getInt(info, "nTestingIterationOverride", m_nTestingIterationOverride);
     m_strDefaultModelGroup         = info.GetString("strDefaultModelGroup");
     m_strGpuIds         = getString(info, "strGpuIds", m_strGpuIds);
     m_imageDbLoadMethod = (IMAGEDB_LOAD_METHOD)getInt(info, "ImageDbLoadMethod", (int)m_imageDbLoadMethod);
     m_nImageDbLoadLimit = getInt(info, "ImageDbLoadLimit", m_nImageDbLoadLimit);
     m_nAutoRefreshScheduledUpdateInMs      = getInt(info, "ImageDbAutoRefreshScheduledUpdateInMs", m_nAutoRefreshScheduledUpdateInMs);
     m_dfAutoRefreshScheduledReplacementPct = getDouble(info, "ImageDbAutoRefreshReplacementPct", m_dfAutoRefreshScheduledReplacementPct);
     m_bImageDbLoadDataCriteria             = getBool(info, "ImageDbLoadDataCriteria", m_bImageDbLoadDataCriteria);
     m_bImageDbLoadDebugData      = getBool(info, "ImageDbLoadDebugData", m_bImageDbLoadDebugData);
     m_snapshotWeightUpdateMethod = (SNAPSHOT_WEIGHT_UPDATE_METHOD)getInt(info, "SnapshotWeightUpdateMethod", (int)m_snapshotWeightUpdateMethod);
     m_snapshotLoadMethod         = (SNAPSHOT_LOAD_METHOD)getInt(info, "SnapshotLoadMethod", (int)m_snapshotLoadMethod);
     m_bSkipMeanCheck             = getBool(info, "SkipMeanCheck", m_bSkipMeanCheck);
 }
コード例 #5
0
ファイル: SettingsCaffe.cs プロジェクト: alllucky1996/MyCaffe
 /// <summary>
 /// The SettingsCaffe constructor that copies another SettingsCaffe instance.
 /// </summary>
 public SettingsCaffe(SettingsCaffe s)
 {
     m_imgDbVersion                 = s.m_imgDbVersion;
     m_bEnableLabelBalancing        = s.m_bEnableLabelBalancing;
     m_bEnableLabelBoosting         = s.m_bEnableLabelBoosting;
     m_bEnableRandomInputSelection  = s.m_bEnableRandomInputSelection;
     m_bEnablePairInputSelection    = s.m_bEnablePairInputSelection;
     m_bUseTrainingSourceForTesting = s.m_bUseTrainingSourceForTesting;
     m_dfSuperBoostProbability      = s.m_dfSuperBoostProbability;
     m_nMaximumIterationOverride    = s.m_nMaximumIterationOverride;
     m_nTestingIterationOverride    = s.m_nTestingIterationOverride;
     m_strDefaultModelGroup         = s.m_strDefaultModelGroup;
     m_strGpuIds         = s.m_strGpuIds;
     m_imageDbLoadMethod = s.m_imageDbLoadMethod;
     m_nImageDbLoadLimit = s.m_nImageDbLoadLimit;
     m_nAutoRefreshScheduledUpdateInMs      = s.m_nAutoRefreshScheduledUpdateInMs;
     m_dfAutoRefreshScheduledReplacementPct = s.m_dfAutoRefreshScheduledReplacementPct;
     m_bImageDbLoadDataCriteria             = s.m_bImageDbLoadDataCriteria;
     m_bImageDbLoadDebugData      = s.m_bImageDbLoadDebugData;
     m_snapshotWeightUpdateMethod = s.m_snapshotWeightUpdateMethod;
     m_snapshotLoadMethod         = s.m_snapshotLoadMethod;
     m_bSkipMeanCheck             = s.m_bSkipMeanCheck;
 }
コード例 #6
0
ファイル: TestBase.cs プロジェクト: Pandinosaurus/MyCaffe
        public TestBase(string strName, int nDeviceID = DEFAULT_DEVICE_ID, EngineParameter.Engine engine = EngineParameter.Engine.DEFAULT, object tag = null, bool bHalf = false)
        {
            m_bHalf = bHalf;

            // If an auto test has set the GPUID, us it instead.
            LocalDataStoreSlot lds = Thread.GetNamedDataSlot("GPUID");

            if (lds != null)
            {
                object obj = Thread.GetData(lds);
                if (obj != null)
                {
                    string strGpuId = obj.ToString();
                    if (!string.IsNullOrEmpty(strGpuId))
                    {
                        int nVal;

                        if (int.TryParse(strGpuId, out nVal) && nDeviceID < 4)
                        {
                            nDeviceID = nVal;
                        }
                    }
                }
            }

            // If an auto test has set the IMGDB_VER, use it instead of the default.
            LocalDataStoreSlot ldsv = Thread.GetNamedDataSlot("IMGDBVER");

            if (ldsv != null)
            {
                object obj = Thread.GetData(ldsv);
                if (obj != null)
                {
                    string strImgDbVer = obj.ToString();
                    if (!string.IsNullOrEmpty(strImgDbVer))
                    {
                        int nVal;

                        if (int.TryParse(strImgDbVer, out nVal) && (nVal == 0 || nVal == 1))
                        {
                            m_imgDbVer = (IMGDB_VERSION)nVal;
                        }
                    }
                }
            }

            // If an auto test has set the CULTURE, use it instead of the default.
            LocalDataStoreSlot ldsc = Thread.GetNamedDataSlot("CULTURE");

            if (ldsc != null)
            {
                object obj = Thread.GetData(ldsc);
                if (obj != null)
                {
                    string strCulture = obj.ToString();
                    if (!string.IsNullOrEmpty(strCulture))
                    {
                        m_defaultCulture = Thread.CurrentThread.CurrentCulture;
                        Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(strCulture);
                    }
                }
            }

            LocalDataStoreSlot ldsp = Thread.GetNamedDataSlot("CUDAPATH");

            if (ldsp != null)
            {
                object obj = Thread.GetData(ldsp);
                if (obj != null)
                {
                    m_strCudaPath = obj.ToString();
                }
            }

            string strPath = CudaPath;

            CudaDnn <float> .SetDefaultCudaPath(strPath);

            CudaDnn <double> .SetDefaultCudaPath(strPath);

            m_strName = strName;

            if (create_count == 1)
            {
                ITest iTestF = create(DataType.FLOAT, strName, nDeviceID, engine);
                if (iTestF != null)
                {
                    iTestF.SetParent(this);
                    iTestF.initialize();
                    m_rgTests.Add(iTestF);
                }

                ITest iTestD = create(DataType.DOUBLE, strName, nDeviceID, engine);
                if (iTestD != null)
                {
                    iTestD.SetParent(this);
                    iTestD.initialize();
                    m_rgTests.Add(iTestD);
                }
            }
            else
            {
                for (int i = 0; i < create_count; i++)
                {
                    ITest iTestF = create(i, DataType.FLOAT, strName, nDeviceID, engine);
                    if (iTestF != null)
                    {
                        iTestF.SetParent(this);
                        iTestF.initialize();
                        m_rgTests.Add(iTestF);
                    }

                    ITest iTestD = create(i, DataType.DOUBLE, strName, nDeviceID, engine);
                    if (iTestD != null)
                    {
                        iTestD.SetParent(this);
                        iTestD.initialize();
                        m_rgTests.Add(iTestD);
                    }
                }
            }
        }