# SciML demos

**URL:** <https://discourse.julialang.org/t/sciml-demos/98893>\
**Category:** General Usage\
**Created:** [May 15, 2023, 7:12pm UTC](https://discourse.julialang.org/t/sciml-demos/98893 "2023-05-15T19:12:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [May 15, 2023, 7:12pm UTC](https://discourse.julialang.org/t/sciml-demos/98893/1 "2023-05-15T19:12:39Z")

</div>

I am going over some demos in SciML. Consider the code fragment found at  
[https://docs.sciml.ai/Overview/stable/showcase/missing\_physics/#autocomplete](https://docs.sciml.ai/Overview/stable/showcase/missing_physics/#autocomplete)

```julia
function predict(θ, X = Xₙ[:, 1], T = t)
    _prob = remake(prob_nn, u0 = X, tspan = (T[1], T[end]), p = θ)
    Array(solve(_prob, Vern7(), saveat = T,
                abstol = 1e-6, reltol = 1e-6))
end

function loss(θ)
    X̂ = predict(θ)
    mean(abs2, Xₙ .- X̂)
end

```

I do not understand the call to `predict(θ)` in the `loss` function. For default arguments to work properly, shouldn’t the second and third arguments of `predict` follow a semi-colon? In other words, shouldn’t the function have the prototype:

```julia
function predict(θ; X = Xₙ[:, 1], T = t)

```

Thanks.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [May 15, 2023, 9:23pm UTC](https://discourse.julialang.org/t/sciml-demos/98893/2 "2023-05-15T21:23:10Z")

</div>

Positional arguments can also have default values:

```julia
julia> f(x, y = 1) = x + y
f (generic function with 2 methods)

julia> f(2)
3

julia> f(2, 4)
6

```

---

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [May 15, 2023, 9:53pm UTC](https://discourse.julialang.org/t/sciml-demos/98893/3 "2023-05-15T21:53:06Z")

</div>

Thanks. I guess the difference is that these arguments cannot have a key. Only the value must be specified.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [May 15, 2023, 10:47pm UTC](https://discourse.julialang.org/t/sciml-demos/98893/4 "2023-05-15T22:47:12Z")

</div>

> I guess the difference is that these arguments cannot have a key. Only the value must be specified.

Correct. Positional arguments appear before the `;`. Keyword arguments appear after the `;`.
