Пример #1
0
        VocabularyBuilder(NGramStrategy nGramStrategy)
        {
            if (nGramStrategy == null)
            {
                throw new ArgumentException();
            }

            this.nGramStrategy = nGramStrategy;
        }
Пример #2
0
        public NeuralHandler(String PartOftrainedNetwork, Position positon, List <VocabularyWord> vocabulary, NGramStrategy nGramStrategy)
        {
            if (positon == null ||
                positon.getName().Equals("") ||
                positon.getPossibleValues() == null ||
                positon.getPossibleValues().Count == 0 ||
                vocabulary == null ||
                vocabulary.Count == 0 ||
                nGramStrategy == null)
            {
                throw new ArgumentException();
            }

            this.positon         = positon;
            this.vocabulary      = vocabulary;
            this.inputLayerSize  = vocabulary.Count;
            this.outputLayerSize = positon.getPossibleValues().Count;
            this.nGramStrategy   = nGramStrategy;

            if (PartOftrainedNetwork == null)
            {
                this.network = createNeuralNetwork();
            }
            else
            {
                // load neural network from file
                try
                {
                    this.network = (BasicNetwork)EncogDirectoryPersistence.LoadObject(new FileInfo(PartOftrainedNetwork));
                }
                catch (PersistError e)
                {
                    throw new ArgumentException();
                }
            }
        }
Пример #3
0
 public NeuralHandler(Position positon, List <VocabularyWord> vocabulary, NGramStrategy nGramStrategy) : this(null, positon, vocabulary, nGramStrategy)
 {
 }