Exemplo n.º 1
0
        /// <summary>
        /// Updates the configuration list of inputs
        /// </summary>
        private void UpdateInputConfigList()
        {
            // Get values from the input list
            InputFeatures = GetInputValues <Node>("InputFeatures").ToList();

            // Make sure that the list is initialised
            if (m_DesiredInputsConfig == null)
            {
                m_DesiredInputsConfig = new List <IMLSpecifications.InputsEnum>();
            }

            // Adjust the desired inputs list based on nodes connected
            m_DesiredInputsConfig.Clear();
            // Go through all the nodes connected
            for (int i = 0; i < InputFeatures.Count; i++)
            {
                // Cast the node checking if implements the feature interface (it is a featureExtractor)
                IFeatureIML inputFeature = InputFeatures[i] as IFeatureIML;

                // If it is a feature extractor...
                if (inputFeature != null)
                {
                    // We add the feature to the desired inputs config
                    DesiredInputsConfig.Add((IMLSpecifications.InputsEnum)inputFeature.FeatureValues.DataType);
                }
            }
        }
 protected void UpdateDesiredOutputFeatures()
 {
     DesiredOutputFeatures.Clear();
     for (int i = 0; i < TargetValues.Count; i++)
     {
         IFeatureIML targetValue = TargetValues[i] as IFeatureIML;
         DesiredOutputFeatures.Add(targetValue.FeatureValues);
     }
 }
 protected void UpdateDesiredInputFeatures()
 {
     m_DesiredInputFeatures.Clear();
     for (int i = 0; i < InputFeatures.Count; i++)
     {
         IFeatureIML inputValue = InputFeatures[i] as IFeatureIML;
         m_DesiredInputFeatures.Add(inputValue.FeatureValues);
     }
 }
        /// <summary>
        /// Updates the configuration list of target values
        /// </summary>
        protected void UpdateTargetValuesConfig()
        {
            m_DesiredOutputsConfig.Clear();
            if (m_DesiredOutputsConfig.Count != TargetValues.Count)
            {
                for (int i = 0; i < TargetValues.Count; i++)
                {
                    // Cast the node checking if implements the feature interface (it is a featureExtractor)
                    IFeatureIML targetValue = TargetValues[i] as IFeatureIML;

                    // If it is a feature extractor...
                    if (targetValue != null)
                    {
                        // We add the feature to the desired inputs config
                        m_DesiredOutputsConfig.Add((IMLSpecifications.OutputsEnum)targetValue.FeatureValues.DataType);
                    }
                }
            }
        }