Skip to content

Commit

Permalink
rename noise policies properly
Browse files Browse the repository at this point in the history
  • Loading branch information
kengz committed Apr 19, 2017
1 parent c650b04 commit be6c2a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
12 changes: 6 additions & 6 deletions rl/policy/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def update(self, sys_vars):
self.n_step = sys_vars['epi']


class AnnealedGaussian(LinearNoisePolicy):
class AnnealedGaussianPolicy(LinearNoisePolicy):

'''
Base class of random noise policy for DDPG
Expand All @@ -71,7 +71,7 @@ class AnnealedGaussian(LinearNoisePolicy):
def __init__(self, env_spec, exploration_anneal_episodes,
mu, sigma, sigma_min,
**kwargs): # absorb generic param without breaking
super(AnnealedGaussian, self).__init__(
super(AnnealedGaussianPolicy, self).__init__(
env_spec, exploration_anneal_episodes)
self.size = env_spec['action_dim']
self.mu = mu
Expand All @@ -92,12 +92,12 @@ def current_sigma(self):
return sigma


class GaussianWhiteNoise(AnnealedGaussian):
class GaussianWhiteNoisePolicy(AnnealedGaussianPolicy):

def __init__(self, env_spec, exploration_anneal_episodes=20,
mu=0., sigma=.3, sigma_min=None,
**kwargs): # absorb generic param without breaking
super(GaussianWhiteNoise, self).__init__(
super(GaussianWhiteNoisePolicy, self).__init__(
env_spec, exploration_anneal_episodes,
mu, sigma, sigma_min)

Expand All @@ -106,7 +106,7 @@ def sample(self):
return sample


class OUNoise(AnnealedGaussian):
class OUNoisePolicy(AnnealedGaussianPolicy):

'''
Based on
Expand All @@ -116,7 +116,7 @@ class OUNoise(AnnealedGaussian):
def __init__(self, env_spec, exploration_anneal_episodes=20,
theta=.15, mu=0., sigma=.3, dt=1e-2, x0=None, sigma_min=None,
**kwargs): # absorb generic param without breaking
super(OUNoise, self).__init__(
super(OUNoisePolicy, self).__init__(
env_spec, exploration_anneal_episodes,
mu, sigma, sigma_min,
**kwargs)
Expand Down
4 changes: 2 additions & 2 deletions rl/spec/component_locks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"DDPG"
],
"Policy": [
"GaussianWhiteNoise",
"GaussianWhiteNoisePolicy",
"LinearNoisePolicy",
"NoNoisePolicy",
"OUNoise"
"OUNoisePolicy"
]
},
"actor_critic": {
Expand Down
25 changes: 0 additions & 25 deletions rl/spec/dev_experiment_specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,30 +120,5 @@
"gamma": [0.97, 0.99],
"lr": [0.01, 0.1]
}
},
"dev": {
"problem": "CartPole-v0",
"Agent": "DDPG",
"HyperOptimizer": "GridSearch",
"Memory": "LinearMemoryWithForgetting",
"Optimizer": "AdamOptimizer",
"Policy": "OUNoise",
"PreProcessor": "NoPreProcessor",
"param": {
"lr": 0.01,
"decay": 0.0,
"gamma": 0.99,
"hidden_layers": [64],
"hidden_layers_activation": "sigmoid",
"output_layer_activation": "linear",
"exploration_anneal_episodes": 10,
"auto_architecture": false,
"num_hidden_layers": 3,
"first_hidden_layer_size": 512
},
"param_range": {
"gamma": [0.97, 0.99],
"lr": [0.01, 0.1]
}
}
}

0 comments on commit be6c2a9

Please sign in to comment.