-
-
Notifications
You must be signed in to change notification settings - Fork 163
Initialize line split fixes following Catalyst.jl PR #1306 #982
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
Conversation
This commit creates the branch for fixing line splits following Catalyst.jl PR #1306 guidelines. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed 6 instances of unnecessary line splits across multiple files: - src/ffjord.jl: Fixed 2 mathematical expressions (logpz calculation and cat function call) - src/multiple_shooting.jl: Fixed 2 arithmetic expressions with continuity_loss - docs/src/examples/augmented_neural_ode.md: Fixed 2 identical arithmetic expressions in random_point_in_sphere function All changes follow Catalyst.jl PR #1306 guidelines to improve readability by keeping semantically related expressions on single lines while staying under 120 character limits. Related to: JuliaFormatter.jl PR #934 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
function random_point_in_sphere(dim, min_radius, max_radius) | ||
distance = (max_radius - min_radius) .* (rand(Float32, 1) .^ (1.0f0 / dim)) .+ | ||
min_radius | ||
distance = (max_radius - min_radius) .* (rand(Float32, 1) .^ (1.0f0 / dim)) .+ min_radius |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
distance = (max_radius - min_radius) .* (rand(Float32, 1) .^ (1.0f0 / dim)) .+ min_radius | |
distance = (max_radius - min_radius) .* (rand(Float32, 1) .^ (1.0f0 / dim)) .+ | |
min_radius |
function random_point_in_sphere(dim, min_radius, max_radius) | ||
distance = (max_radius - min_radius) .* (rand(Float32, 1) .^ (1.0f0 / dim)) .+ | ||
min_radius | ||
distance = (max_radius - min_radius) .* (rand(Float32, 1) .^ (1.0f0 / dim)) .+ min_radius |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
distance = (max_radius - min_radius) .* (rand(Float32, 1) .^ (1.0f0 / dim)) .+ min_radius | |
distance = (max_radius - min_radius) .* (rand(Float32, 1) .^ (1.0f0 / dim)) .+ | |
min_radius |
if regularize | ||
return cat(mz, -trace_jac, sum(abs2, mz; dims = 1:(N - 1)), | ||
__norm_batched(eJ); dims = Val(N - 1)) | ||
return cat(mz, -trace_jac, sum(abs2, mz; dims = 1:(N - 1)), __norm_batched(eJ); dims = Val(N - 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
return cat(mz, -trace_jac, sum(abs2, mz; dims = 1:(N - 1)), __norm_batched(eJ); dims = Val(N - 1)) | |
return cat(mz, -trace_jac, sum(abs2, mz; dims = 1:(N - 1)), | |
__norm_batched(eJ); dims = Val(N - 1)) |
if n.basedist === nothing | ||
logpz = -sum(abs2, z; dims = 1:(N - 1)) / T(2) .- | ||
T(prod(S[1:(N - 1)]) / 2 * log(2π)) | ||
logpz = -sum(abs2, z; dims = 1:(N - 1)) / T(2) .- T(prod(S[1:(N - 1)]) / 2 * log(2π)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
logpz = -sum(abs2, z; dims = 1:(N - 1)) / T(2) .- T(prod(S[1:(N - 1)]) / 2 * log(2π)) | |
logpz = -sum(abs2, z; dims = 1:(N - 1)) / T(2) .- | |
T(prod(S[1:(N - 1)]) / 2 * log(2π)) |
# and current initial condition in ode_data | ||
loss += continuity_term * | ||
continuity_loss(group_predictions[i - 1][griddims..., end], u[griddims..., 1]) | ||
loss += continuity_term * continuity_loss(group_predictions[i - 1][griddims..., end], u[griddims..., 1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
loss += continuity_term * continuity_loss(group_predictions[i - 1][griddims..., end], u[griddims..., 1]) | |
loss += continuity_term * continuity_loss( | |
group_predictions[i - 1][griddims..., end], u[griddims..., 1]) |
# and current initial condition in ode_data | ||
loss += continuity_term * | ||
continuity_loss(group_predictions[i - 1][griddims..., end, :], u[griddims..., 1, :]) | ||
loss += continuity_term * continuity_loss(group_predictions[i - 1][griddims..., end, :], u[griddims..., 1, :]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
loss += continuity_term * continuity_loss(group_predictions[i - 1][griddims..., end, :], u[griddims..., 1, :]) | |
loss += continuity_term * continuity_loss( | |
group_predictions[i - 1][griddims..., end, :], u[griddims..., 1, :]) |
Initialize fixing unnecessary line splits following Catalyst.jl PR #1306 guidelines. Part of systematic effort across 10+ SciML repositories. 🤖 Generated with Claude Code