<commit_before>﻿using NeuralNet;
using NeuralNet.Neurons;
using NeuralNet.Training;
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleNeuralNets
{
    class Program
    {
        static void Main(string[] args)
        {
            BackpropNetwork bpn = new BackpropNetwork(0.0005, 0.01);
            bpn.Initialize(8, 15, 2);

            TrainingSet ts = new TrainingSet(bpn.Layers.InputLayer, bpn.Layers.OutputLayer);
            ts.Add(new TrainingSample(new List<double>() { 1, 0, 1, 0, 1, 0, 1, 0 }, new List<double> { 0.4, 0.9 }));
            ts.Add(new TrainingSample(new List<double>() { 1, 1, 1, 1, 1, 1, 1, 1 }, new List<double> { 0.2, 0.3 }));
            ts.Add(new TrainingSample(new List<double>() { 0, 0, 0, 0, 0, 0, 0, 0 }, new List<double> { 0.3, 0.5 }));
            bpn.TrainingEpochEvent += bpn_TrainingEpochEvent;
            bpn.Train(ts, int.MaxValue, 0.0000001);

            /*double error = 1;
            do
            {
                error = bpn.Train(ts);
                Console.WriteLine(error);
            } while (error > 0.0001);
            */
            while (true)
            {
                List<string> s = Console.ReadLine().Split(' ').ToList();
                List<double> inputs = new List<double>();<commit_msg>Console app learns seven segment.<commit_after>﻿using NeuralNet;
using NeuralNet.Neurons;
using NeuralNet.Training;
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleNeuralNets
{
    class Program
    {
        static void Main(string[] args)
        {
            BackpropNetwork bpn = new BackpropNetwork(0.9, 0.04);
            bpn.Initialize(7, 7, 1);

            TrainingSet ts = new TrainingSet(bpn.Layers.InputLayer, bpn.Layers.OutputLayer);
            /*ts.Add(new TrainingSample(new List<double>() { 1, 0, 1, 0, 1, 0, 1 }, new List<double> { 0.1, 0.2, 0.3, 0.4}));
            ts.Add(new TrainingSample(new List<double>() { 1, 1, 1, 1, 1, 1, 1 }, new List<double> { 0.2, 0.3, 0.7, 0.8}));
            ts.Add(new TrainingSample(new List<double>() { 0, 0, 0, 0, 0, 0, 0 }, new List<double> { 0.3, 0.5, 0.6, 0.2 }));*/

            ts.Add(new TrainingSample(new List<double>() { 1, 1, 1, 1, 1, 1, 0 }, new List<double> { 0.05 }));
            ts.Add(new TrainingSample(new List<double>() { 0, 1, 1, 0, 0, 0, 0 }, new List<double> { 0.1 }));
            ts.Add(new TrainingSample(new List<double>() { 1, 1, 0, 1, 1, 0, 1 }, new List<double> { 0.2 }));
            ts.Add(new TrainingSample(new List<double>() { 1, 1, 1, 1, 0, 0, 1 }, new List<double> { 0.3 }));
            ts.Add(new TrainingSample(new List<double>() { 0, 1, 1, 0, 0, 1, 1 }, new List<double> { 0.4 }));
            ts.Add(new TrainingSample(new List<double>() { 1, 0, 1, 1, 0, 1, 1 }, new List<double> { 0.5 }));
            ts.Add(new TrainingSample(new List<double>() { 1, 0, 1, 1, 1, 1, 1 }, new List<double> { 0.6 }));
            ts.Add(new TrainingSample(new List<double>() { 1, 1, 1, 0, 0, 0, 0 }, new List<double> { 0.7 }));
            ts.Add(new TrainingSample(new List<double>() { 1, 1, 1, 1, 1, 1, 1 }, new List<double> { 0.8 }));
            ts.Add(new TrainingSample(new List<double>() { 1, 1, 1, 1, 0, 1, 1 }, new List<double> { 0.9 }));
            bpn.TrainingEpochEvent += bpn_TrainingEpochEvent;
            bpn.Train(ts, int.MaxValue, 0.001);

            /*double error = 1;
            do
            {
                error = bpn.Train(ts);
                Console.WriteLine(error);
            } while (error > 0.0001);
            */
            while (true)
            {
                List<string> s = Console.ReadLine().Split(' ').ToList();
                List<double> inputs = new List<double>();
{'fraction_non_alphanumeric': 0.16680032076984763, 'fraction_numerical': 0.057738572574178026, 'mean_word_length': 2.139261744966443, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4983054', 'n_tokens_mistral': 1441, 'n_tokens_neox': 1249, 'n_words': 342}