Skip to content

Fixed several typos #11179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion research/autoaugment/augmentation_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def zero_pad_and_crop(img, amount=4):

Args:
img: numpy image that will be zero padded and cropped.
amount: amount of zeros to pad `img` with horizontally and verically.
amount: amount of zeros to pad `img` with horizontally and vertically.

Returns:
The cropped zero padded img. The returned numpy array will be of the same
Expand Down
2 changes: 1 addition & 1 deletion research/autoaugment/train_cifar.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def _compute_final_accuracies(self, meval):
return valid_accuracy, test_accuracy

def run_model(self):
"""Trains and evalutes the image model."""
"""Trains and evaluates the image model."""
hparams = self.hparams

# Build the child graph
Expand Down
10 changes: 5 additions & 5 deletions research/cognitive_planning/envs/active_vision_dataset_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def read_all_poses(dataset_root, world):
id of each view and the values are tuple of (x, z, R, scale). Where x and z
are the first and third coordinate of translation. R is the 3x3 rotation
matrix and scale is a float scalar that indicates the scale that needs to
be multipled to x and z in order to get the real world coordinates.
be multiplied to x and z in order to get the real world coordinates.

Raises:
ValueError: if the number of images do not match the number of poses read.
Expand Down Expand Up @@ -675,7 +675,7 @@ def _step_no_reward(self, action):

Returns:
observation, done, info
observation: dictonary that contains all the observations specified in
observation: dictionary that contains all the observations specified in
modality_types.
observation[task_env.ModalityTypes.OBJECT_DETECTION]: contains the
detection of the current view.
Expand Down Expand Up @@ -897,7 +897,7 @@ def _reset_env(
self._vertex_to_pose[self._cur_world] = {
index: (-index,) for index in self._cur_graph.target_indexes.values()
}
# Calling vetex_to_pose for each vertex results in filling out the
# Calling vertex_to_pose for each vertex results in filling out the
# dictionaries that contain pose related data.
for image_id in self._world_id_dict[self._cur_world]:
self.vertex_to_pose(self.to_vertex(image_id))
Expand Down Expand Up @@ -951,7 +951,7 @@ def vertex_to_pose(self, v):
v: integer, vertex index.

Returns:
(x, z, dir_x, dir_z) where x and z are the tranlation and dir_x, dir_z are
(x, z, dir_x, dir_z) where x and z are the translation and dir_x, dir_z are
a vector giving direction of the view.
"""
if v in self._vertex_to_pose[self._cur_world]:
Expand Down Expand Up @@ -996,7 +996,7 @@ def check_scene_graph(self, world, goal):
"""
obs = self._reset_env(new_world=world, new_goal=goal)
if not obs:
print '{} is not availble in {}'.format(goal, world)
print '{} is not available in {}'.format(goal, world)
return True
for image_id in self._world_id_dict[self._cur_world]:
print 'check image_id = {}'.format(image_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def preprocess_for_train(image,
image: A `Tensor` representing an image of arbitrary size.
output_height: The height of the image after preprocessing.
output_width: The width of the image after preprocessing.
padding: The amound of padding before and after each dimension of the image.
padding: The amount of padding before and after each dimension of the image.
add_image_summaries: Enable image summaries.

Returns:
Expand Down
12 changes: 6 additions & 6 deletions research/cognitive_planning/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def classification_loss(truth, predicted, weights=None, is_one_hot=True):

Computes the mean of cross entropy losses for all pairs of true labels and
predictions. It wraps around a tf implementation of the cross entropy loss
with additional reformating of the inputs. If the truth and predicted are
with additional reformatting of the inputs. If the truth and predicted are
n-rank Tensors with n > 2, then these are reshaped to 2-rank Tensors. It
allows for truth to be specified as one hot vector or class indices. Finally,
a weight can be specified for each element in truth and predicted.
Expand Down Expand Up @@ -489,7 +489,7 @@ def _obs_to_state(self, path, states):
[np.reshape(p, [1, 2]) for p in path_coordinates])

# The observations are taken along a smoothed trajectory following the path.
# We compute a mapping between the obeservations and the map vertices.
# We compute a mapping between the observations and the map vertices.
path_to_obs = collections.defaultdict(list)
obs_to_state = []
for i, s in enumerate(states):
Expand Down Expand Up @@ -634,7 +634,7 @@ def episode(self):
assert len(observations.values()[0]) == len(states)

# The observations are taken along a smoothed trajectory following the path.
# We compute a mapping between the obeservations and the map vertices.
# We compute a mapping between the observations and the map vertices.
path_to_obs, obs_to_path = self._obs_to_state(path, states)

# Go over all observations, and sample a query. With probability 0.5 this
Expand Down Expand Up @@ -751,7 +751,7 @@ def episode(self):
2 x observation_size X observation_size x 3 containing a pair of query
images.
A tuple of size two. First element is a numpy array of size 2 containing
a one hot vector of whether the two observations are neighobring. Second
a one hot vector of whether the two observations are neighboring. Second
element is a boolean numpy value denoting whether this is a valid
episode.
"""
Expand Down Expand Up @@ -1166,7 +1166,7 @@ def _compute_gt_value(self, vertex, target_vertices):
closer to the goal the value is 1. In case, it takes the agent one step away
from the goal it would be -1. If it leads to collision or if the agent uses
action stop before reaching to the goal it is -2. To avoid scale issues the
gt_values are multipled by 0.5.
gt_values are multiplied by 0.5.

Args:
vertex: integer, the index of current vertex.
Expand Down Expand Up @@ -1355,7 +1355,7 @@ def _compute_gt_value(self, vertex, target_vertices):
closer to the goal the value is 1. In case, it takes the agent one step away
from the goal it would be -1. If it leads to collision or if the agent uses
action stop before reaching to the goal it is -2. To avoid scale issues the
gt_values are multipled by 0.5.
gt_values are multiplied by 0.5.

Args:
vertex: integer, the index of current vertex.
Expand Down
8 changes: 4 additions & 4 deletions research/cognitive_planning/train_supervised_active_vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
flags.DEFINE_integer('save_summaries_secs', 300,
'number of seconds between saving summaries')
flags.DEFINE_integer('save_interval_secs', 300,
'numer of seconds between saving variables')
'number of seconds between saving variables')
flags.DEFINE_integer('log_every_n_steps', 20, 'number of steps between logging')
flags.DEFINE_string('modality_types', '',
'modality names in _ separated format')
Expand Down Expand Up @@ -122,8 +122,8 @@
flags.DEFINE_bool('freeze_resnet_weights', True, '')
flags.DEFINE_string(
'eval_init_points_file_name', '',
'Name of the file that containts the initial locations and'
'worlds for each evalution point')
'Name of the file that contains the initial locations and'
'worlds for each evaluation point')

FLAGS = flags.FLAGS
TRAIN_WORLDS = [
Expand Down Expand Up @@ -377,7 +377,7 @@ def init(sequence_length, eval_init_points_file_name, worlds):
logging.info('modality types: %r', modality_types)
# negative reward_goal_range prevents the env from terminating early when the
# agent is close to the goal. The policy should keep the agent until the end
# of the 100 steps either through chosing stop action or oscilating around
# of the 100 steps either through choosing stop action or oscillating around
# the target.

env = active_vision_dataset_env.ActiveVisionDatasetEnv(
Expand Down
8 changes: 4 additions & 4 deletions research/cognitive_planning/visualization_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ def draw_bounding_boxes_on_image_tensors(images,
with keypoints.
max_boxes_to_draw: Maximum number of boxes to draw on an image. Default 20.
min_score_thresh: Minimum score threshold for visualization. Default 0.2.
use_normalized_coordinates: Whether to assume boxes and kepoints are in
normalized coordinates (as opposed to absolute coordiantes).
use_normalized_coordinates: Whether to assume boxes and keypoints are in
normalized coordinates (as opposed to absolute coordinates).
Default is True.

Returns:
Expand Down Expand Up @@ -402,8 +402,8 @@ def draw_side_by_side_evaluation_image(eval_dict,
category_index: A category index (dictionary) produced from a labelmap.
max_boxes_to_draw: The maximum number of boxes to draw for detections.
min_score_thresh: The minimum score threshold for showing detections.
use_normalized_coordinates: Whether to assume boxes and kepoints are in
normalized coordinates (as opposed to absolute coordiantes).
use_normalized_coordinates: Whether to assume boxes and keypoints are in
normalized coordinates (as opposed to absolute coordinates).
Default is True.

Returns:
Expand Down