From 26e40f60da9058607efdc2f8251aba466de2ac9f Mon Sep 17 00:00:00 2001 From: Nicolai Anton Lynnerup Date: Thu, 11 Jul 2019 08:38:09 +0200 Subject: [PATCH 1/5] Updated README.md to contain installation instructions for virtual-env --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 783f996..a2a8b99 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ +# Installation + +Assumes a clean install of Ubuntu 18.04 LTS + +- Install deps + +```bash +sudo apt update +sudo apt install python3-dev python3-pip +sudo pip3 install -U virtualenv # system-wide install +``` + +- Create virtualenv + +```bash +virtualenv --system-site-packages -p python3 ./p4e_env +``` + +- Source environment and install deps + +```bash +pip3 install --upgrade tensorflow(-gpu) +pip3 install keras-rl +pip3 install numpy +pip3 install 'gym[box2d]' +pip3 install 'gym[classic_control]' +``` + # Framework agnostic example scripts From 1803669f7ccccc8a0733f6d5810dbae73f2dd892 Mon Sep 17 00:00:00 2001 From: Nicolai Anton Lynnerup Date: Thu, 11 Jul 2019 08:38:28 +0200 Subject: [PATCH 2/5] Outcommented unused algs in example file --- evaluate_algorithm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluate_algorithm.py b/evaluate_algorithm.py index 1ec2562..0815bcc 100644 --- a/evaluate_algorithm.py +++ b/evaluate_algorithm.py @@ -1,6 +1,6 @@ from prototype4evaluation.tasks.CartPole2018.cartpole2018 import CartPole2018 -from prototype4evaluation.algorithms_wrapped.random import RandomAlgorithm -from prototype4evaluation.algorithms_wrapped.vpg import REINFORCEAlgorithm, algorithm_hyperparameters +#from prototype4evaluation.algorithms_wrapped.random import RandomAlgorithm +#from prototype4evaluation.algorithms_wrapped.vpg import REINFORCEAlgorithm, algorithm_hyperparameters from prototype4evaluation.algorithms_wrapped.dqn import DQNAlgorithm, algorithm_hyperparameters from prototype4evaluation.Pipeline import Pipeline From 58a8927157e6c96df6d70e5d0f26e9092b2fe6e7 Mon Sep 17 00:00:00 2001 From: Nicolai Anton Lynnerup Date: Thu, 11 Jul 2019 08:38:57 +0200 Subject: [PATCH 3/5] Changed "replicated" to "repeat" --- prototype4evaluation/Pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prototype4evaluation/Pipeline.py b/prototype4evaluation/Pipeline.py index 5ba4352..71fc60e 100644 --- a/prototype4evaluation/Pipeline.py +++ b/prototype4evaluation/Pipeline.py @@ -20,7 +20,7 @@ def run(self, training_steps): evaluation = self.evaluation_constructor(**self.evaluation_arguments) for rank in range(3): - print('Replicate {}/{}'.format(rank+1, 3)) + print('Repeat {}/{}'.format(rank+1, 3)) algorithm = self.algorithm_constructor(evaluation.environment_details, **self.algorithm_arguments) From 4fe3990c776e9b453a6d7f5f54fb1f18308b794a Mon Sep 17 00:00:00 2001 From: Nicolai Anton Lynnerup Date: Thu, 11 Jul 2019 09:21:01 +0200 Subject: [PATCH 4/5] Reversed changes --- evaluate_algorithm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evaluate_algorithm.py b/evaluate_algorithm.py index 0815bcc..1c1de9d 100644 --- a/evaluate_algorithm.py +++ b/evaluate_algorithm.py @@ -1,6 +1,6 @@ from prototype4evaluation.tasks.CartPole2018.cartpole2018 import CartPole2018 -#from prototype4evaluation.algorithms_wrapped.random import RandomAlgorithm -#from prototype4evaluation.algorithms_wrapped.vpg import REINFORCEAlgorithm, algorithm_hyperparameters +from prototype4evaluation.algorithms_wrapped.random import RandomAlgorithm +from prototype4evaluation.algorithms_wrapped.vpg import REINFORCEAlgorithm, algorithm_hyperparameters from prototype4evaluation.algorithms_wrapped.dqn import DQNAlgorithm, algorithm_hyperparameters from prototype4evaluation.Pipeline import Pipeline @@ -18,4 +18,4 @@ evaluation_results = pipeline.run(100) print(evaluation_results.records) # the raw curves - print(evaluation_results.get_performance()) # the summary \ No newline at end of file + print(evaluation_results.get_performance()) # the summary From cc4c3afb6217f341b7b3d97a5c29703a83dac411 Mon Sep 17 00:00:00 2001 From: Nicolai Anton Lynnerup Date: Thu, 11 Jul 2019 09:21:21 +0200 Subject: [PATCH 5/5] Fixed error where repeats were hardcoded --- prototype4evaluation/Pipeline.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prototype4evaluation/Pipeline.py b/prototype4evaluation/Pipeline.py index 71fc60e..410fe25 100644 --- a/prototype4evaluation/Pipeline.py +++ b/prototype4evaluation/Pipeline.py @@ -12,6 +12,7 @@ def __init__(self, self.algorithm_arguments = algorithm_arguments self.evaluation_constructor = evaluation_constructor self.evaluation_arguments = evaluation_arguments + self.repeats = repeats def _run_parallel(self): raise NotImplementedError('Future work.') @@ -19,7 +20,7 @@ def _run_parallel(self): def run(self, training_steps): evaluation = self.evaluation_constructor(**self.evaluation_arguments) - for rank in range(3): + for rank in range(self.repeats): print('Repeat {}/{}'.format(rank+1, 3)) algorithm = self.algorithm_constructor(evaluation.environment_details, **self.algorithm_arguments)