Skip to content

Commit

Permalink
fix typos (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkterry1 committed Jan 26, 2021
1 parent 15411aa commit 90e38e5
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion all/bodies/_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Body(Agent):
"""
A Body wraps a reinforcment learning Agent, altering its inputs and ouputs.
A Body wraps a reinforcement learning Agent, altering its inputs and outputs.
The Body API is identical to the Agent API from the perspective of the
rest of the system. This base class is provided only for semantic clarity.
Expand Down
6 changes: 3 additions & 3 deletions all/environments/_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def name(self):
@abstractmethod
def reset(self):
"""
Reset the environment and return a new intial state.
Reset the environment and return a new initial state.
Returns
-------
Expand Down Expand Up @@ -58,7 +58,7 @@ def render(self, **kwargs):
@abstractmethod
def close(self):
"""
Clean up any extraneaous environment objects.
Clean up any extraneous environment objects.
"""

@property
Expand All @@ -83,7 +83,7 @@ def state_space(self):
@property
def observation_space(self):
"""
Alias for Environemnt.state_space.
Alias for Environment.state_space.
Returns
-------
Expand Down
4 changes: 2 additions & 2 deletions all/environments/_multiagent_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MultiagentEnvironment(ABC):
@abstractmethod
def reset(self):
'''
Reset the environment and return a new intial state for the first agent.
Reset the environment and return a new initial state for the first agent.
Returns
all.core.MultiagentState: The initial state for the next episode.
Expand All @@ -39,7 +39,7 @@ def render(self, **kwargs):

@abstractmethod
def close(self):
'''Clean up any extraneaous environment objects.'''
'''Clean up any extraneous environment objects.'''

@abstractmethod
def agent_iter(self):
Expand Down
4 changes: 2 additions & 2 deletions all/environments/multiagent_pettingzoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, zoo_env, name, device='cuda'):
}

'''
Reset the environment and return a new intial state.
Reset the environment and return a new initial state.
Returns:
An initial MultiagentState object.
Expand All @@ -43,7 +43,7 @@ def reset(self):
return self.last()

'''
Reset the environment and return a new intial state.
Reset the environment and return a new initial state.
Args:
action (int): An int or tensor containing a single integer representing the action.
Expand Down
2 changes: 1 addition & 1 deletion all/experiments/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test(self, episodes=100):
Test the agent in eval mode for a certain number of episodes.
Args:
episodes (int): The number of test epsiodes.
episodes (int): The number of test episodes.
Returns:
list(float): A list of all returns received during testing.
Expand Down
2 changes: 1 addition & 1 deletion all/experiments/multiagent_env_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def train(self, frames=np.inf, episodes=np.inf):
Test the agent in eval mode for a certain number of episodes.
Args:
episodes (int): The number of test epsiodes.
episodes (int): The number of test episodes.
Returns:
list(float): A list of all returns received during testing.
Expand Down
4 changes: 2 additions & 2 deletions all/memory/segment_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, capacity, operation, neutral_element):
operation which reduces `operation` over
a contiguous subsequence of items in the
array.
Paramters
Parameters
---------
capacity: int
Total size of the array - must be a power of two.
Expand Down Expand Up @@ -108,7 +108,7 @@ def find_prefixsum_idx(self, prefixsum):
Parameters
----------
perfixsum: float
upperbound on the sum of array prefix
upper bound on the sum of array prefix
Returns
-------
idx: int
Expand Down
4 changes: 2 additions & 2 deletions all/nn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class Aggregation(nn.Module):
https://arxiv.org/abs/1511.06581
This layer computes a Q function by combining
an estimate of V with an estimate of the advantage.
The advantage is normalized by substracting the average
advantage so that we can propertly
The advantage is normalized by subtracting the average
advantage so that we can properly
"""

def forward(self, value, advantages):
Expand Down
4 changes: 2 additions & 2 deletions all/policies/greedy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GreedyPolicy(Schedulable):
An "epsilon-greedy" action selection policy for discrete action spaces.
This policy will usually choose the optimal action according to an approximation
of the action value function (the "q-function"), but with probabilty epsilon will
of the action value function (the "q-function"), but with probability epsilon will
choose a random action instead. GreedyPolicy is a Schedulable, meaning that
epsilon can be varied over time by passing a Scheduler object.
Expand Down Expand Up @@ -47,7 +47,7 @@ class ParallelGreedyPolicy(Schedulable):
A parallel version of the "epsilon-greedy" action selection policy for discrete action spaces.
This policy will usually choose the optimal action according to an approximation
of the action value function (the "q-function"), but with probabilty epsilon will
of the action value function (the "q-function"), but with probability epsilon will
choose a random action instead. GreedyPolicy is a Schedulable, meaning that
epsilon can be varied over time by passing a Scheduler object.
Expand Down
2 changes: 1 addition & 1 deletion all/presets/atari/c51.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class C51AtariPreset(Preset):
atoms (int): The number of atoms in the categorical distribution used to represent
the distributional value function.
v_min (int): The expected return corresponding to the smallest atom.
v_max (int): The expected return correspodning to the larget atom.
v_max (int): The expected return corresponding to the largest atom.
model_constructor (function): The function used to construct the neural model.
"""

Expand Down
2 changes: 1 addition & 1 deletion all/presets/atari/ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PPOAtariPreset(ParallelPreset):
value_loss_scaling (float): Coefficient for the value function loss.
clip_initial (float): Value for epsilon in the clipped PPO objective function at the beginning of training.
clip_final (float): Value for epsilon in the clipped PPO objective function at the end of training.
epochs (int): Number of times to iterature through each batch.
epochs (int): Number of times to literature through each batch.
minibatches (int): The number of minibatches to split each batch into.
n_envs (int): Number of parallel actors.
n_steps (int): Length of each rollout.
Expand Down
2 changes: 1 addition & 1 deletion all/presets/atari/rainbow.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class RainbowAtariPreset(Preset):
atoms (int): The number of atoms in the categorical distribution used to represent
the distributional value function.
v_min (int): The expected return corresponding to the smallest atom.
v_max (int): The expected return correspodning to the larget atom.
v_max (int): The expected return corresponding to the largest atom.
sigma (float): Initial noisy network noise.
model_constructor (function): The function used to construct the neural model.
"""
Expand Down
2 changes: 1 addition & 1 deletion all/presets/classic_control/ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PPOClassicControlPreset(ParallelPreset):
value_loss_scaling (float): Coefficient for the value function loss.
clip_initial (float): Value for epsilon in the clipped PPO objective function at the beginning of training.
clip_final (float): Value for epsilon in the clipped PPO objective function at the end of training.
epochs (int): Number of times to iterature through each batch.
epochs (int): Number of times to literature through each batch.
minibatches (int): The number of minibatches to split each batch into.
n_envs (int): Number of parallel actors.
n_steps (int): Length of each rollout.
Expand Down
2 changes: 1 addition & 1 deletion all/presets/classic_control/rainbow.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class RainbowClassicControlPreset(Preset):
atoms (int): The number of atoms in the categorical distribution used to represent
the distributional value function.
v_min (int): The expected return corresponding to the smallest atom.
v_max (int): The expected return correspodning to the larget atom.
v_max (int): The expected return corresponding to the largest atom.
sigma (float): Initial noisy network noise.
model_constructor (function): The function used to construct the neural model.
"""
Expand Down
2 changes: 1 addition & 1 deletion all/presets/continuous/ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PPOContinuousPreset(ParallelPreset):
# is no greater than this bound. Set to 0 to disable.
clip_initial (float): Value for epsilon in the clipped PPO objective function at the beginning of training.
clip_final (float): Value for epsilon in the clipped PPO objective function at the end of training.
epochs (int): Number of times to iterature through each batch.
epochs (int): Number of times to literature through each batch.
minibatches (int): The number of minibatches to split each batch into.
n_envs (int): Number of parallel actors.
n_steps (int): Length of each rollout.
Expand Down
22 changes: 11 additions & 11 deletions all/presets/preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Preset(ABC):
"""
A Preset Agent factory.
This class allows the user to instansiate preconfigured Agents and test Agents.
This class allows the user to instantiate preconfigured Agents and test Agents.
All Agents constructed by the Preset share a network model and parameters.
However, other objects, such as ReplayBuffers, are independently created for each Agent.
The Preset can be saved and loaded from disk.
Expand All @@ -20,14 +20,14 @@ def __init__(self, name, device, hyperparameters):
@abstractmethod
def agent(self, writer=None, train_steps=float('inf')):
"""
Instansiate a training-mode Agent with the existing model.
Instantiate a training-mode Agent with the existing model.
Args:
writer (all.logging.Writer, optional): Coefficient for the entropy term in the total loss.
train_steps (int, optional): The number of steps for which the agent will be trained.
Returns:
all.agents.Agent: The instansiated Agent.
all.agents.Agent: The instantiated Agent.
"""
pass

Expand All @@ -37,7 +37,7 @@ def test_agent(self):
Instansiate a test-mode Agent with the existing model.
Returns:
all.agents.Agent: The instansiated test Agent.
all.agents.Agent: The instantiated test Agent.
"""
pass

Expand All @@ -46,7 +46,7 @@ def save(self, filename):
Save the preset and the contained model to disk.
The preset can later be loaded using torch.load(filename), allowing
a test mode agent to be instansiated for evaluation or other purposes.
a test mode agent to be instantiated for evaluation or other purposes.
Args:
filename (str): The path where the preset should be saved.
Expand All @@ -59,7 +59,7 @@ class ParallelPreset():
A Preset ParallelAgent factory.
This is the ParallelAgent version of all.presets.Preset.
This class allows the user to instansiate preconfigured ParallelAgents and test Agents.
This class allows the user to instantiate preconfigured ParallelAgents and test Agents.
All Agents constructed by the ParallelPreset share a network model and parameters.
However, other objects, such as ReplayBuffers, are independently created for each Agent.
The ParallelPreset can be saved and loaded from disk.
Expand All @@ -73,24 +73,24 @@ def __init__(self, name, device, hyperparameters):
@abstractmethod
def agent(self, writer=None, train_steps=float('inf')):
"""
Instansiate a training-mode ParallelAgent with the existing model.
Instantiate a training-mode ParallelAgent with the existing model.
Args:
writer (all.logging.Writer, optional): Coefficient for the entropy term in the total loss.
train_steps (int, optional): The number of steps for which the agent will be trained.
Returns:
all.agents.ParallelAgent: The instansiated Agent.
all.agents.ParallelAgent: The instantiated Agent.
"""
pass

@abstractmethod
def test_agent(self):
"""
Instansiate a test-mode Agent with the existing model.
Instantiate a test-mode Agent with the existing model.
Returns:
all.agents.Agent: The instansiated test Agent.
all.agents.Agent: The instantiated test Agent.
"""
pass

Expand All @@ -103,7 +103,7 @@ def save(self, filename):
Save the preset and the contained model to disk.
The preset can later be loaded using torch.load(filename), allowing
a test mode agent to be instansiated for evaluation or other purposes.
a test mode agent to be instantiated for evaluation or other purposes.
Args:
filename (str): The path where the preset should be saved.
Expand Down

0 comments on commit 90e38e5

Please sign in to comment.