vmayoral / basic_reinforcement_learning Goto Github PK
View Code? Open in Web Editor NEWAn introductory series to Reinforcement Learning (RL) with comprehensive step-by-step tutorials.
License: GNU General Public License v3.0
An introductory series to Reinforcement Learning (RL) with comprehensive step-by-step tutorials.
License: GNU General Public License v3.0
I'm getting lots of errors when I try to run the code for tutorial 1. Kindly advise.
Screen dump:
(base) administrator@ubuntu:/basic_reinforcement_learning/tutorial1$ python3 egoMouseLook.py/basic_reinforcement_learning/tutorial1$ nano egoMouseLook.py
File "egoMouseLook.py", line 162
print len(mouse.ai.q) # print the amount of state/action, reward
^
SyntaxError: invalid syntax
(base) administrator@ubuntu:
(base) administrator@ubuntu:/basic_reinforcement_learning/tutorial1$ python3 egoMouseLook.py/basic_reinforcement_learning/tutorial1$ python egoMouseLook.py
Traceback (most recent call last):
File "egoMouseLook.py", line 7, in
import cellular
File "/home/administrator/basic_reinforcement_learning/tutorial1/cellular.py", line 521
print 'Error: invalid colour:', c
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Error: invalid colour:', c)?
(base) administrator@ubuntu:
Traceback (most recent call last):
File "egoMouseLook.py", line 7, in
import cellular
File "/home/administrator/basic_reinforcement_learning/tutorial1/cellular.py", line 521
print 'Error: invalid colour:', c
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Error: invalid colour:', c)?
(base) administrator@ubuntu:/basic_reinforcement_learning/tutorial1$ nano cellular.py/basic_reinforcement_learning/tutorial1$ python egoMouseLook.py
(base) administrator@ubuntu:
Traceback (most recent call last):
File "egoMouseLook.py", line 8, in
reload(cellular)
NameError: name 'reload' is not defined
(base) administrator@ubuntu:/basic_reinforcement_learning/tutorial1$ python3 egoMouseLook.py/basic_reinforcement_learning/tutorial1$ cd ..
Traceback (most recent call last):
File "egoMouseLook.py", line 8, in
reload(cellular)
NameError: name 'reload' is not defined
(base) administrator@ubuntu:
(base) administrator@ubuntu:/basic_reinforcement_learning$ python tutorial1/egoMouseLook.py/basic_reinforcement_learning$ cd tutorial1
Traceback (most recent call last):
File "tutorial1/egoMouseLook.py", line 8, in
reload(cellular)
NameError: name 'reload' is not defined
(base) administrator@ubuntu:
(base) administrator@ubuntu:/basic_reinforcement_learning/tutorial1$ nano egoMouseLook.py/basic_reinforcement_learning/tutorial1$ python3 egoMouseLook.py
(base) administrator@ubuntu:
Traceback (most recent call last):
File "egoMouseLook.py", line 133, in
world = cellular.World(Cell, directions=directions, filename='../worlds/waco.txt')
File "/home/administrator/basic_reinforcement_learning/tutorial1/cellular.py", line 102, in init
data = file(filename).readlines()
NameError: name 'file' is not defined
(base) administrator@ubuntu:/basic_reinforcement_learning/tutorial1$ nano egoMouseLook.py/basic_reinforcement_learning/tutorial1$ python3 egoMouseLook.py
(base) administrator@ubuntu:
egoMouseLook.py:9: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
Traceback (most recent call last):
File "egoMouseLook.py", line 134, in
world = cellular.World(Cell, directions=directions, filename='../worlds/waco.txt')
File "/home/administrator/basic_reinforcement_learning/tutorial1/cellular.py", line 102, in init
data = file(filename).readlines()
NameError: name 'file' is not defined
env.monitor.start('/tmp/cartpole-experiment-1',force=True)
AttributeError: 'TimeLimit' object has no attribute 'monitor'
gym.upload('/tmp/cartpole-experiment-1', api_key='sk_5YJsWfHOQwOLiU3AAVyYeA')
AttributeError: module 'gym' has no attribute 'upload'
In tutorial1, qlearn_mod_random.py
line 32:
if random.random() < self.epsilon:
minQ = min(q)
mag = max(abs(minQ), abs(maxQ))
# add random values to all the actions, recalculate maxQ
q = [q[i] + random.random() * mag - .5 * mag for i in range(len(self.actions))]
maxQ = max(q)
why use this(versus qlearn.py
)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.