input argument order in deep learning functions

1 回表示 (過去 30 日間)
feynman feynman
feynman feynman 2022 年 12 月 3 日
コメント済み: feynman feynman 2022 年 12 月 3 日
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)

採用された回答

Stephen23
Stephen23 2022 年 12 月 3 日
編集済み: Stephen23 2022 年 12 月 3 日
"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 件のコメント
Walter Roberson
Walter Roberson 2022 年 12 月 3 日
The summary syntax would literally include
Name, Value
if a call supports name/value pairs
feynman feynman
feynman feynman 2022 年 12 月 3 日
thank you walter!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by