Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fca025f
chapter 18 learning
bruceyoungsysu Jun 14, 2019
db2a98b
add chapter 19
bruceyoungsysu Jun 15, 2019
b5253aa
move init dataset in NN learner
bruceyoungsysu Jun 15, 2019
dcf56db
add adam optimizer, add nn learner
bruceyoungsysu Jun 15, 2019
72a8b19
Merge remote-tracking branch 'upstream/master' into learning
bruceyoungsysu Jun 15, 2019
e5fb00c
remove cpt 19 for debug
bruceyoungsysu Jun 16, 2019
765e0a1
change while loop in games4e
bruceyoungsysu Jun 16, 2019
339bfc7
add chapter 19
bruceyoungsysu Jun 16, 2019
9474929
add sgd and adam optimizer
bruceyoungsysu Jun 18, 2019
f966d1b
add chpt19 deep nn
bruceyoungsysu Jun 18, 2019
2f870cb
add rnn
bruceyoungsysu Jun 20, 2019
06ebd78
add auto encoder
bruceyoungsysu Jun 20, 2019
13aaf74
add comments, correct tests
bruceyoungsysu Jun 23, 2019
2799614
add more comments, change algorithms according to orders of chapter s…
bruceyoungsysu Jun 30, 2019
7975f4a
add keras and numpy to requirements
bruceyoungsysu Jun 30, 2019
cf764fa
add tf as requirement
bruceyoungsysu Jun 30, 2019
2f9d689
add gc in test agent
bruceyoungsysu Jun 30, 2019
09a664e
fix agent bugs for running test_agent and test_agent_4e together
bruceyoungsysu Jul 1, 2019
8814b2a
fix build error
bruceyoungsysu Jul 1, 2019
3bcbfc1
add chapter 21 and 22
bruceyoungsysu Jul 5, 2019
c8c0618
add chapter 12 and part of 13
bruceyoungsysu Jul 14, 2019
fa88fa7
remove chapter 12 and 13, add test of rl
bruceyoungsysu Jul 14, 2019
b74decf
modify rnn test
bruceyoungsysu Jul 14, 2019
babaafb
fix build error
bruceyoungsysu Jul 26, 2019
bce3eee
Merge branch 'master' into learning
bruceyoungsysu Aug 4, 2019
ee201cd
Update utils4e.py
bruceyoungsysu Aug 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
505 changes: 505 additions & 0 deletions DeepNeuralNet4e.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion agents_4e.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def add_thing(self, thing, location=(1, 1), exclude_duplicate_class_items=False)
def is_inbounds(self, location):
"""Checks to make sure that the location is inbounds (within walls if we have walls)"""
x, y = location
return not (x < self.x_start or x >= self.x_end or y < self.y_start or y >= self.y_end)
return not (x < self.x_start or x > self.x_end or y < self.y_start or y > self.y_end)

def random_location_inbounds(self, exclude=None):
"""Returns a random location that is inbounds (within walls if we have walls)"""
Expand Down
4 changes: 2 additions & 2 deletions games4e.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ def backprop(n, utility):

root = MCT_Node(state=state)

while N > 0:
for _ in range(N):
leaf = select(root)
child = expand(leaf)
result = simulate(game, child.state)
backprop(child, result)
N -= 1

max_state = max(root.children, key=lambda p: p.N)

return root.children.get(max_state)
Expand Down
Loading