jax-js
System
Light
Dark
Search…
Preparing search index...
@jax-js/jax
valueAndGrad
Function valueAndGrad
valueAndGrad
<
F
extends
(
...
args
:
any
[]
)
=>
JsTree
<
Array
>
>
(
f
:
F
,
)
:
(
...
primals
:
MappedJsTree
<
Parameters
<
F
>
,
Array
,
ArrayLike
>
,
)
=>
[
ReturnType
<
F
>
,
MappedJsTree
<
Parameters
<
F
>
[
0
]
,
ArrayLike
,
Array
>
]
Create a function that evaluates both
f
and the gradient of
f
.
Type Parameters
F
extends
(
...
args
:
any
[]
)
=>
JsTree
<
Array
>
Parameters
f
:
F
Returns
(
...
primals
:
MappedJsTree
<
Parameters
<
F
>
,
Array
,
ArrayLike
>
,
)
=>
[
ReturnType
<
F
>
,
MappedJsTree
<
Parameters
<
F
>
[
0
]
,
ArrayLike
,
Array
>
]
jax-js
Loading...
Create a function that evaluates both
fand the gradient off.