Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushinav committed Mar 4, 2024
2 parents a867862 + e68f778 commit 6189427
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 239 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- AdaptiveLoss
- Logging
- Forward
- NeuralAdapter
- DGM
version:
- "1"
Expand All @@ -50,6 +51,8 @@ jobs:
- uses: julia-actions/julia-processcoverage@v1
with:
directories: src,lib/NeuralPDELogging/src
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
4 changes: 3 additions & 1 deletion .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
exit(0) # Exit immediately, as a success
end
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
13 changes: 6 additions & 7 deletions src/neural_adapter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ function get_bounds_(domains, eqs, eltypeθ, dict_indvars, dict_depvars, strateg
for d in domains])
args = get_argument(eqs, dict_indvars, dict_depvars)

bounds = map(args) do pd
bounds = first(map(args) do pd
span = map(p -> get(dict_span, p, p), pd)
map(s -> adapt(eltypeθ, s), span)
end
bounds
end)
bounds = [getindex.(bounds, 1), getindex.(bounds, 2)]
return bounds
end

function get_loss_function_(loss, init_params, pde_system, strategy::StochasticTraining)
Expand All @@ -46,8 +47,7 @@ function get_loss_function_(loss, init_params, pde_system, strategy::StochasticT
pde_system.depvars)

eltypeθ = eltype(init_params)
bound = get_bounds_(domains, eqs, eltypeθ, dict_indvars, dict_depvars, strategy)[1]

bound = get_bounds_(domains, eqs, eltypeθ, dict_indvars, dict_depvars, strategy)
get_loss_function(loss, bound, eltypeθ, strategy)
end

Expand All @@ -62,8 +62,7 @@ function get_loss_function_(loss, init_params, pde_system, strategy::QuasiRandom
pde_system.depvars)

eltypeθ = eltype(init_params)
bound = get_bounds_(domains, eqs, eltypeθ, dict_indvars, dict_depvars, strategy)[1]

bound = get_bounds_(domains, eqs, eltypeθ, dict_indvars, dict_depvars, strategy)
get_loss_function(loss, bound, eltypeθ, strategy)
end

Expand Down
1 change: 0 additions & 1 deletion src/training_strategies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ end
function get_loss_function(loss_function, bound, eltypeθ, strategy::StochasticTraining;
τ = nothing)
points = strategy.points

loss = (θ) -> begin
sets = generate_random_points(points, bound, eltypeθ)
sets_ = adapt(parameterless_type(ComponentArrays.getdata(θ)), sets)
Expand Down
Loading

0 comments on commit 6189427

Please sign in to comment.