Skip to content
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

fix typos #238

Merged
merged 1 commit into from
Jun 11, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ end
"""
rand_tangent([rng::AbstractRNG,] x)

Returns a arbitary tangent vector _appropriate_ for the primal value `x`.
Returns an arbitrary tangent vector _appropriate_ for the primal value `x`.
Note that despite the name, no promises on the statistical randomness are made.
Rather it is an arbitary value, that is generated using the `rng`.
Rather it is an arbitrary value, that is generated using the `rng`.
"""
rand_tangent(x) = rand_tangent(Random.GLOBAL_RNG, x)

Expand Down
8 changes: 4 additions & 4 deletions src/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ difference method, `bound_estimator`, will be tasked with estimating the `P`th o
derivative in a _neighbourhood_, not just at some `x`. To do this, it will use a careful
reweighting of the function evaluations to estimate the `P`th order derivative at, in the
case of a central method, `x - h`, `x`, and `x + h`, where `h` is the step size. The
coeffients for this estimate, the _neighbourhood estimate_, are given by the three sets of
coeffients in `bound_estimator.coefs_neighbourhood`. The round-off error is estimated by the
round-off error of the function evaluations performed by `bound_estimator`. The trunction
coefficients for this estimate, the _neighbourhood estimate_, are given by the three sets of
coefficients in `bound_estimator.coefs_neighbourhood`. The round-off error is estimated by the
round-off error of the function evaluations performed by `bound_estimator`. The truncation
error is amplified by `condition`, and the round-off error is amplified by `factor`. The
quantities `∇f_magnitude_mult` and `f_error_mult` are precomputed quantities that facilitate
the step size adaptation procedure.
Expand Down Expand Up @@ -490,7 +490,7 @@ for direction in [:forward, :central, :backward]
geom::Bool=false
)

Contruct a finite difference method at a $($(Meta.quot(direction))) grid of `p` points.
Construct a finite difference method at a $($(Meta.quot(direction))) grid of `p` points.

# Arguments
- `p::Int`: Number of grid points.
Expand Down
4 changes: 2 additions & 2 deletions src/to_vec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ end

function to_vec(x::F) where {F <: SVD}
# Convert the vector S to a matrix so we can work with a vector of matrices
# only and inferrence work
# only and inference work
v = [x.U, reshape(x.S, length(x.S), 1), x.Vt]
x_vec, back = to_vec(v)
function SVD_from_vec(v)
Expand All @@ -216,7 +216,7 @@ end

function to_vec(x::S) where {U, S <: Union{LinearAlgebra.QRCompactWYQ{U}, LinearAlgebra.QRCompactWY{U}}}
# x.T is composed of upper triangular blocks. The subdiagonals elements
# of the blocks are abitrary. We make sure to set all of them to zero
# of the blocks are arbitrary. We make sure to set all of them to zero
# to avoid NaN.
blocksize, cols = size(x.T)
T = zeros(U, blocksize, cols)
Expand Down
2 changes: 1 addition & 1 deletion test/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ rand_tangent(args...) = @test_deprecated FiniteDifferences.rand_tangent(args...)
)
end

@testset "compsition of addition" begin
@testset "composition of addition" begin
x = Foo(1.5, 2, Foo(1.1, 3, [1.7, 1.4, 0.9]))
@test x + rand_tangent(x) isa typeof(x)
@test x + (rand_tangent(x) + rand_tangent(x)) isa typeof(x)
Expand Down
2 changes: 1 addition & 1 deletion test/grad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ using FiniteDifferences: grad, jacobian, _jvp, jvp, j′vp, _j′vp, to_vec
@test _jvp(fdm, f, x, ẋ) ≈ J_exact * ẋ
@test _j′vp(fdm, f, ȳ, x) ≈ transpose(J_exact) * ȳ

# Check that no mutation occured that wasn't reverted.
# Check that no mutation occurred that wasn't reverted.
@test xc == x
end

Expand Down
2 changes: 1 addition & 1 deletion test/to_vec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ end
test_to_vec(cholesky(P))

# Special treatment for QR since it is represented by a matrix
# with some arbirtrary values.
# with some arbitrary values.
F = qr(M)
@inferred to_vec(F)
F_vec, back = to_vec(F)
Expand Down
Loading