input argument order in deep learning functions

For those that have many input arguments, does the order of the input arguments affect the result of the function. For example, is
[___] = adamupdate(___learnRate,gradDecay,sqGradDecay,epsilon)
different from
[___] = adamupdate(___gradDecay,sqGradDecay,epsilon,learnRate)
and if so, does matlab support inputting arguments like the following?
[___] = adamupdate(___learnRate=0.1,gradDecay=0,sqGradDecay=0,epsilon=1)

 Accepted Answer

Stephen23
Stephen23 on 3 Dec 2022
Edited: Stephen23 on 3 Dec 2022
"For those that have many input arguments, does the order of the input arguments affect the result of the function."
In general, yes, the input order is significant.
"... is ... different from... "
Yes. In general MATLAB input arguments are positional, so their position determines the meaning of that input (not the variable name or anything else).
"...does matlab support inputting arguments like the following"
Yes, but only for particular arguments that are known in the documentation as "name-value" arguments. For example, the CELLFUN documentation lists exactly two name-value arguments (in addition to the positional input arguments):
The syntax that you show using name-value is supported only since 2021a:
The ADAMUPDATE documentation does not list any name-value input arguments.

5 Comments

thanks a lot. Now that using name-value is supported since 2021a, is doing so in ADAMUPDATE supported?
"Now that using name-value is supported since 2021a, is doing so in ADAMUPDATE supported?"
I already answered that: "... only for particular arguments that are known in the documentation as "name-value" arguments...The ADAMUPDATE documentation does not list any name-value input arguments."
The ADAMUPDATE documentation does not have name-value input arguments, so you cannot use name-value input arguments with ADAMUPDATE. It is unclear why you think that you can.
It seems that you are still confusing positional input arguments (i.e. the ones that most MATLAB functions use, including ADAMUPDATE) and name-values input arguments (which ADAMUPDATE does not have, as I already wrote in my answer). I explained the difference in my answer.
thanks a lot that's clear. Then how/where to tell in ADAMUPDATE documentation that name-value input arguments aren't available? I hope to be able to judge on other occasions.
The summary syntax would literally include
Name, Value
if a call supports name/value pairs

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!