public static LeNetConfiguration FromCharacters(params char[] characters)
 {
     LeNetConfiguration result = new LeNetConfiguration(characters.Length);
     Array.Copy(characters, result.Characters, characters.Length);
     for (int i = 0; i < characters.Length; i++)
     {
         char character = characters[i];
         if (characters.Count(item => character == item) > 1) throw new ArgumentException();
         double[] definition = GenerateCharacterDefinition(character);
         Array.Copy(definition, 0, result.ClassDefinitions, i * LeNetNetwork.OutputFeedForwardNeurons, definition.Length);
     }
     return result;
 }
예제 #2
0
        public static LeNetConfiguration FromCharacters(params char[] characters)
        {
            LeNetConfiguration result = new LeNetConfiguration(characters.Length);

            Array.Copy(characters, result.Characters, characters.Length);
            for (int i = 0; i < characters.Length; i++)
            {
                char character = characters[i];
                if (characters.Count(item => character == item) > 1)
                {
                    throw new ArgumentException();
                }
                double[] definition = GenerateCharacterDefinition(character);
                Array.Copy(definition, 0, result.ClassDefinitions, i * LeNetNetwork.OutputFeedForwardNeurons, definition.Length);
            }
            return(result);
        }
예제 #3
0
        public void Initialise()
        {
            Console.WriteLine("Loading Training Data Set...");

            trainingDataSet = DataSets.GetTrainingSet().Randomise(0);
            Console.WriteLine("Loading Generalisation Data Set...");
            generalisationDataSet = DataSets.GetGeneralisationSet().Randomise(1);

            Console.WriteLine("Creating LeNet...");
            LeNetConfiguration configuration = LeNetConfigurations.FromCharacters('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');

            Network  = new LeNetNetwork(configuration);
            Snapshot = new LeNetSnapshot(Network);

            Network.LearningRate = 0.0005 / 16.0;
            Network.Mu           = 0.02;
            bool isPreTraining = Network.IsPreTraining;
        }