Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 9 additions & 6 deletions pureples/shared/gym_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def eval_fitness(genomes, config):
fitnesses = []

for _ in range(trials):
ob = env.reset()
ob = env.reset()[0]
net.reset()

total_reward = 0
Expand All @@ -45,7 +45,8 @@ def eval_fitness(genomes, config):
o = net.activate(ob)

action = np.argmax(o)
ob, reward, done, _ = env.step(action)
ob, reward, terminated, truncated, _ = env.step(action)
done = terminated or truncated
total_reward += reward
if done:
break
Expand Down Expand Up @@ -91,7 +92,7 @@ def eval_fitness(genomes, config):
fitnesses = []

for _ in range(trials):
ob = env.reset()
ob = env.reset()[0]
net.reset()

total_reward = 0
Expand All @@ -100,7 +101,8 @@ def eval_fitness(genomes, config):
for _ in range(activations):
o = net.activate(ob)
action = np.argmax(o)
ob, reward, done, _ = env.step(action)
ob, reward, terminated, truncated, _ = env.step(action)
done = terminated or truncated
total_reward += reward
if done:
break
Expand Down Expand Up @@ -143,14 +145,15 @@ def eval_fitness(genomes, config):
fitnesses = []

for _ in range(trials):
ob = env.reset()
ob = env.reset()[0]

total_reward = 0

for _ in range(max_steps):
o = net.activate(ob)
action = np.argmax(o)
ob, reward, done, _ = env.step(action)
ob, reward, terminated, truncated, _ = env.step(action)
done = terminated or truncated
total_reward += reward
if done:
break
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='pureples',
version='0.0',
version='0.1',
author='adrian, simon',
author_email='mail@adrianwesth.dk',
maintainer='simon, adrian',
Expand Down