Exemplo n.º 1
0
        void InitComponentFeaturizer()
        {
            var fc = m_FeatureConfiguration;

            m_SparseDimension = 0;
            if (m_TFeaturizer != null)
            {
                if (fc.ContainsKey(TFEATURE_CONTEXT) == true)
                {
                    m_SparseDimension += m_TFeaturizer.GetFeatureSize() * fc[TFEATURE_CONTEXT].Count;
                }
            }

            if (fc.ContainsKey(RT_FEATURE_CONTEXT) == true)
            {
                m_SparseDimension += TagSet.GetSize() * fc[RT_FEATURE_CONTEXT].Count;
            }

            m_DenseDimension = 0;
            if (m_WordEmbedding != null)
            {
                if (fc.ContainsKey(WORDEMBEDDING_CONTEXT) == true)
                {
                    m_DenseDimension += m_WordEmbedding.GetDimension() * fc[WORDEMBEDDING_CONTEXT].Count;
                }
            }
        }
Exemplo n.º 2
0
        public void ShowFeatureSize()
        {
            var fc = featureContext;

            if (tFeaturizer != null)
            {
                Logger.WriteLine("Template feature size: {0}", tFeaturizer.GetFeatureSize());
            }

            if (fc.ContainsKey(TFEATURE_CONTEXT))
            {
                Logger.WriteLine("Template feature context size: {0}",
                                 tFeaturizer.GetFeatureSize() * fc[TFEATURE_CONTEXT].Count);
            }

            if (fc.ContainsKey(RT_FEATURE_CONTEXT))
            {
                Logger.WriteLine("Run time feature size: {0}", TagSet.GetSize() * fc[RT_FEATURE_CONTEXT].Count);
            }

            if (fc.ContainsKey(WORDEMBEDDING_CONTEXT))
            {
                Logger.WriteLine("Pretrained dense feature size: {0}",
                                 preTrainedModel.GetDimension() * fc[WORDEMBEDDING_CONTEXT].Count);
            }
        }