<commit_before>__author__ = 'Bill'
import NeuralNetwork
import numpy as np
import sys

#Reads in file as an array of arrays.
def readFile(name):
    X = []
    f = open(name,'r')
    for line in f:
        X.append([int(y) for y in line.split(' ')])
    f.close()
    return np.array(X)


def run():
    X = readFile(sys.argv[1])
    Y = readFile(sys.argv[2])

    NN = NeuralNetwork.NeuralNetwork((35, 10, 10))
    train = NeuralNetwork.Trainer(NN)
    print(NN.forward(X))
    print(NN.cost_function(X, Y))
    train.train(X, Y)
    while np.isnan(NN.cost_function(X, Y)) or not (Y * 10 == np.round(NN.forward(X) * 10)).all():
        NN = NeuralNetwork.NeuralNetwork((35, 10, 10))
        #print(NN.cost_function(X, Y))
        train = NeuralNetwork.Trainer(NN)
        train.train(X, Y)
    print(np.round(NN.forward(X) * 10))

    while 1:
        ans = raw_input("input a command, forward on file, exit: ")
        if ans.split(' ')[0] == 'forward':
                print ans.split(' ')
                input = readFile(ans.split(' ')[1])
                print(NN.forward([input]))
        elif ans.split(' ')[0] == 'exit':
                break
        else:
            print "Hashtag Nope Nope Nope."

run()<commit_msg>Smoothed the output<commit_after>__author__ = 'Bill'
import NeuralNetwork
import numpy as np
import sys

#Reads in file as an array of arrays.
def readFile(name):
    X = []
    f = open(name,'r')
    for line in f:
        X.append([int(y) for y in line.split(' ')])
    f.close()
    return np.array(X)


def run():
    X = readFile(sys.argv[1])
    Y = readFile(sys.argv[2])

    NN = NeuralNetwork.NeuralNetwork((35, 10, 10))
    train = NeuralNetwork.Trainer(NN)
    raw_input("Now printing an initial run on the 20 base inputs and their cost function.")
    print(NN.forward(X))
    print(NN.cost_function(X, Y))
    raw_input("Training the network, then training on a monte carlo.")
    train.train(X, Y)
    while np.isnan(NN.cost_function(X, Y)) or not (Y * 10 == np.round(NN.forward(X) * 10)).all():
        NN = NeuralNetwork.NeuralNetwork((35, 10, 10))
        #print(NN.cost_function(X, Y))
        train = NeuralNetwork.Trainer(NN)
        train.train(X, Y)
    raw_input("Now printing the final match results.")
    print(np.round(NN.forward(X) * 10))

    while 1:
        ans = raw_input("input a command, forward on file, exit: ")
        if ans.split(' ')[0] == 'forward':
                print ans.split(' ')
                input = readFile(ans.split(' ')[1])
                print(NN.forward([input]))
        elif ans.split(' ')[0] == 'exit':
                break
        else:
            print "Hashtag Nope Nope Nope."

run()
{'fraction_non_alphanumeric': 0.15298507462686567, 'fraction_numerical': 0.018656716417910446, 'mean_word_length': 2.4240102171136653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '38937', 'n_tokens_mistral': 963, 'n_tokens_neox': 897, 'n_words': 240}