8000 fixed continuous action explorations · pythonAI/tensorforce@a0c6033 · GitHub
[go: up one dir, main page]

Skip to content

Commit a0c6033

Browse files
committed
fixed continuous action explorations
1 parent 03971d5 commit a0c6033

File tree

4 files changed

+8
-34
lines changed

4 files changed

+8
-34
lines changed

tensorforce/core/explorations/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@
1616

1717
from tensorforce.core.explorations.exploration import Exploration
1818
from tensorforce.core.explorations.constant import Constant
19-
from tensorforce.core.explorations.linear_decay import LinearDecay
2019
from tensorforce.core.explorations.epsilon_anneal import EpsilonAnneal
2120
from tensorforce.core.explorations.epsilon_decay import EpsilonDecay
2221
from tensorforce.core.explorations.ornstein_uhlenbeck_process import OrnsteinUhlenbeckProcess
2322

2423

2524
explorations = dict(
2625
constant=Constant,
27-
linear_decay=LinearDecay,
2826
epsilon_anneal=EpsilonAnneal,
2927
epsilon_decay=EpsilonDecay,
3028
ornstein_uhlenbeck=OrnsteinUhlenbeckProcess
3129
)
3230

3331

34-
__all__ = ['Exploration', 'Constant', 'LinearDecay', 'EpsilonDecay', 'OrnsteinUhlenbeckProcess', 'explorations']
32+
__all__ = ['Exploration', 'Constant', 'EpsilonAnneal', 'EpsilonDecay', 'OrnsteinUhlenbeckProcess', 'explorations']

tensorforce/core/explorations/linear_decay.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

tensorforce/core/explorations/ornstein_uhlenbeck_process.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def __init__(
4444

4545
def tf_explore(self, episode, timestep, action_shape):
4646
normal_sample = tf.random_normal(shape=action_shape.shape, mean=0.0, stddev=1.0)
47-
state = tf.get_variable(name='ornstein_uhlenbeck', dtype=util.tf_dtype('float'), shape=action_shape.shape,
48-
initializer=tf.constant_initializer(self.mu))
47+
state = tf.get_variable(
48+
name='ornstein_uhlenbeck',
49+
dtype=util.tf_dtype('float'),
50+
shape=action_shape.shape,
51+
initializer=tf.constant_initializer(self.mu)
52+
)
4953
return tf.assign_add(ref=state, value=(self.theta * (self.mu - state) + self.sigma * normal_sample))

tensorforce/models/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ def tf_action_exploration(self, action, exploration, action_spec):
847847

848848
elif action_spec['type'] == 'float':
849849
for _ in range(util.rank(action) - 1):
850-
exploration_value = tf.expand_dims(input=exploration_value, axis=1)
850+
exploration_value = tf.expand_dims(input=exploration_value, axis=-1)
851851
action += exploration_value
852852
if 'min_value' in action_spec:
853853
action = tf.clip_by_value(

0 commit comments

Comments
 (0)
0