Skip to content

Commit

Permalink
docs: make docstrings have TYPEDSIGNATURES
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosh-b-b committed Feb 9, 2024
1 parent 53cc92b commit 0f1c148
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/DeepBSDE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ end
DeepBSDE(u0, σᵀ∇u; opt = Flux.Optimise.Adam(0.1)) = DeepBSDE(u0, σᵀ∇u, opt)

"""
$(SIGNATURES)
$(TYPEDSIGNATURES)
Returns a `PIDESolution` object.
Expand All @@ -73,6 +73,8 @@ Returns a `PIDESolution` object.
[DifferentialEquations.jl doc](https://diffeq.sciml.ai/stable/solvers/sde_solve/).
- `limits`: if `true`, upper and lower limits will be calculated, based on
[Deep Primal-Dual algorithm for BSDEs](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3071506).
- `maxiters`: The number of training epochs. Defaults to `300`
- `trajectories`: The number of trajectories simulated for training. Defaults to `100`
- Extra keyword arguments passed to `solve` will be further passed to the SDE solver.
"""
function DiffEqBase.solve(prob::ParabolicPDEProblem,
Expand Down
11 changes: 11 additions & 0 deletions src/DeepBSDE_Han.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# called whenever sdealg is not specified.
"""
$(TYPEDSIGNATURES)
Returns a `PIDESolution` object.
# Arguments:
- `maxiters`: The number of training epochs. Defaults to `300`
- `trajectories`: The number of trajectories simulated for training. Defaults to `100`
To use [SDE Algorithms](https://diffeq.sciml.ai/stable/solvers/sde_solve/) use [`DeepBSDE`](@ref)
"""
function DiffEqBase.solve(prob::ParabolicPDEProblem,
alg::DeepBSDE;
dt,
Expand Down
2 changes: 1 addition & 1 deletion src/DeepSplitting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function DeepSplitting(nn;
end

"""
$(SIGNATURES)
$(TYPEDSIGNATURES)
Returns a `PIDESolution` object.
Expand Down
2 changes: 1 addition & 1 deletion src/MLP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
MLP(; M = 4, L = 4, K = 10, mc_sample = NoSampling()) = MLP(M, L, K, mc_sample)

"""
$(SIGNATURES)
$(TYPEDSIGNATURES)
Returns a `PIDESolution` object.
Expand Down
16 changes: 16 additions & 0 deletions src/NNStopping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ function (model::NNStoppingModelArray)(X, G)
broadcast((x, m) -> m(x), eachslice(XG, dims = 2)[2:end], model.ms)
end

"""
$(TYPEDSIGNATURES)
Returns a NamedTuple with `payoff` and `stopping_time`
Arguments:
- `sdealg`: a SDE solver from [DifferentialEquations.jl](https://diffeq.sciml.ai/stable/solvers/sde_solve/).
If not provided, the plain vanilla [DeepBSDE](https://arxiv.org/abs/1707.02568) method will be applied.
If provided, the SDE associated with the PDE problem will be solved relying on
methods from DifferentialEquations.jl, using [Ensemble solves](https://diffeq.sciml.ai/stable/features/ensemble/)
via `sdealg`. Check the available `sdealg` on the
[DifferentialEquations.jl doc](https://diffeq.sciml.ai/stable/solvers/sde_solve/).
- `maxiters`: The number of training epochs. Defaults to `300`
- `trajectories`: The number of trajectories simulated for training. Defaults to `100`
- Extra keyword arguments passed to `solve` will be further passed to the SDE solver.
"""
function DiffEqBase.solve(prob::ParabolicPDEProblem,
pdealg::NNStopping,
sdealg;
Expand Down

0 comments on commit 0f1c148

Please sign in to comment.