Skip to content

Commit

Permalink
[SymForce] A couple of random typos
Browse files Browse the repository at this point in the history
Topic: chaoqu_symforce_typos
GitOrigin-RevId: 46d9645fc2ac203f80029269bccace65e1fc96e2
  • Loading branch information
chao-qu-skydio authored and aaron-skydio committed Apr 21, 2023
1 parent 3cc6061 commit b8821c9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions symforce/opt/barrier_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def symmetric_power_barrier(
power: sf.Scalar,
) -> sf.Scalar:
"""
A symmetric barrier cenetered around x = 0, meaning the error at -x is equal to the error at x.
A symmetric barrier centered around x = 0, meaning the error at -x is equal to the error at x.
The barrier passes through the points (x_nominal, error_nominal) and
(x_nominal - dist_zero_to_nominal, 0) with a curve of the form x^power. For example, the
barrier with power = 1 will look like:
Expand Down Expand Up @@ -282,7 +282,7 @@ def min_max_centering_power_barrier(
------------------*******-------------------
|
It may be easier to vizualize the bounding and centering barriers independently:
It may be easier to visualize the bounding and centering barriers independently:
BOUNDING BARRIER:
** | **
Expand Down
6 changes: 3 additions & 3 deletions symforce/opt/noise_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def pseudo_huber_error(self, x: sf.Scalar) -> sf.Scalar:
def whiten_scalar(self, x: sf.Scalar, bounded_away_from_zero: bool = False) -> sf.Scalar:
"""
Applies a whitening function to a single element of the unwhitened residual such that the
cost associated with the element in the least-sqaures cost function is the Pseudo-Huber
cost associated with the element in the least-squares cost function is the Pseudo-Huber
loss function.
Args:
Expand Down Expand Up @@ -329,7 +329,7 @@ class BarronNoiseModel(ScalarNoiseModel):
by the pseudo-huber loss function.
scalar_information: Scalar representing the inverse of the variance of an element of the
unwhitened residual. Conceptually, we use "scalar_information" to whiten (in a
probabalistic sense) the unwhitened residual before passing it through the Barron loss.
probabilistic sense) the unwhitened residual before passing it through the Barron loss.
x_epsilon: Small value used for handling the singularity at x == 0.
alpha_epsilon: Small value used for handling singularities around alpha.
"""
Expand Down Expand Up @@ -386,7 +386,7 @@ def barron_error(self, x: sf.Scalar) -> sf.Scalar:
def whiten_scalar(self, x: sf.Scalar, bounded_away_from_zero: bool = False) -> sf.Scalar:
"""
Applies a whitening function to a single element of the unwhitened residual such that the
cost associated with the element in the least-sqaures cost function is the Barron loss
cost associated with the element in the least-squares cost function is the Barron loss
function (weighted by self.weight).
Args:
Expand Down
4 changes: 2 additions & 2 deletions symforce/opt/optimization_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ def optimized_keys(self) -> T.List[str]:
subproblem.optimized_values() for subproblem in self.subproblems.values()
)

content_addressible_inputs = {
content_addressable_inputs = {
tuple(ops.StorageOps.to_storage(value)): key for key, value in inputs.items_recursive()
}

optimized_keys = []
for value in optimized_values:
optimized_key = content_addressible_inputs[tuple(ops.StorageOps.to_storage(value))]
optimized_key = content_addressable_inputs[tuple(ops.StorageOps.to_storage(value))]
if value != inputs[optimized_key]:
raise TypeError(
f"Variable returned by `optimized_values()` ({value}) in "
Expand Down
2 changes: 1 addition & 1 deletion test/symforce_codegen_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class SymforceCodegenUtilTest(TestCase):
"""
Tests contents of symforce.codegen.codgen_util.
Tests contents of symforce.codegen.codegen_util.
"""

def test_load_generated_package(self) -> None:
Expand Down

0 comments on commit b8821c9

Please sign in to comment.