<commit_before>#!/usr/local/bin/python

import sys

from pybrain.rl.learners.valuebased import ActionValueNetwork
from pybrain.rl.agents import LearningAgent
from pybrain.rl.learners import NFQ
from pybrain.rl.experiments import EpisodicExperiment

from environment import Lander
from tasks import LanderTask


def main():
    environment = Lander()
    controller = ActionValueNetwork(7, 121)
    learner = NFQ()
    agent = LearningAgent(controller, learner)
    task = LanderTask(environment)
    experiment = EpisodicExperiment(task, agent)

    while True:
        experiment.doEpisodes(20)
        agent.learn()
        agent.reset()
        print('Agent has learned.')


if __name__ == '__main__':
    sys.exit(main())<commit_msg>Updating main based off NFQ example<commit_after>#!/usr/local/bin/python

import sys

from pybrain.rl.learners.valuebased import ActionValueNetwork
from pybrain.rl.agents import LearningAgent
from pybrain.rl.learners import NFQ
from pybrain.rl.experiments import EpisodicExperiment

from environment import Lander
from tasks import LanderTask


def main():
    environment = Lander()
    controller = ActionValueNetwork(7, 121)
    learner = NFQ()
    agent = LearningAgent(controller, learner)
    task = LanderTask(environment)
    experiment = EpisodicExperiment(task, agent)

    for episodes in range(10):
        experiment.doEpisodes(1)
        agent.learn(1)
        print('Agent has learned {0} episodes.'.format(episodes + 1))


if __name__ == '__main__':
    sys.exit(main())
{'fraction_non_alphanumeric': 0.0912672357189757, 'fraction_numerical': 0.010505581089954037, 'mean_word_length': 3.964169381107492, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '576514', 'n_tokens_mistral': 486, 'n_tokens_neox': 453, 'n_words': 120}