<s> from pybrain . rl . agents import LearningAgent <EOL> from pybrain . rl . learners . valuebased import NFQ , ActionValueNetwork <EOL> from pybrain . rl . experiments import EpisodicExperiment <EOL> from environment import Environment <EOL> from tasks import BalanceTask <EOL> from training import NFQTraining <EOL> task = BalanceTask ( only_steer = True ) <EOL> action_value_function = ActionValueNetwork ( task . outdim , task . nactions , <EOL> name = '<STR_LIT>' ) <EOL> learner = NFQ ( ) <EOL> task . discount = learner . gamma <EOL> agent = LearningAgent ( action_value_function , learner ) <EOL> performance_agent = LearningAgent ( action_value_function , None ) <EOL> experiment = EpisodicExperiment ( task , agent ) <EOL> tr = NFQTraining ( '<STR_LIT>' , experiment , performance_agent ) <EOL> tr . train ( <NUM_LIT> , performance_interval = <NUM_LIT:1> , n_performance_episodes = <NUM_LIT:1> , plot_action_history = True ) </s>
