I am getting an error
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am getting an error in my code specially in line convolution1dLayer(128,10,"Name","conv1d","Padding","same").
The error is
File: convolution1dLayer.m
Line: 1 Column: 45 Invalid use of operator.
which leads to
function output = convolution1dLayer(input, "stride",filtersize, "Padding",1 )
I am unable to solve the problem.
Please help
0 Commenti
Risposte (2)
Torsten
il 25 Lug 2024
Do you want to overwrite the MATLAB function "convolution1dLayer" by your own function ?
function output = convolution1dLayer(input, "stride",filtersize, "Padding",1 )
If this is the definition of your newly created function, it's wrong because you cannot hardcode inputs ("stride", "Padding", 1).
2 Commenti
Torsten
il 25 Lug 2024
Modificato: Torsten
il 25 Lug 2024
This line is (ignoring the incorrect definition of inputs) a definition of a new function:
function output = convolution1dLayer(input, "stride",filtersize, "Padding",1 )
If you want to call the MATLAB function "convolution1dLayer", look at the documentation how to call a function and what input arguments are needed for "convolution1dLayer":
Steven Lord
il 25 Lug 2024
This line of code:
function output = convolution1dLayer(input, "stride",filtersize, "Padding",1 )
is not a valid definition of the convolution1dLayer function. The only things that can appear in the input arguments section of a function definition are variable names not literal values. [And as Torsten called out, you shouldn't call your function convolution1dLayer as convolution1dLayer already has a meaning in Deep Learning Toolbox.] If you eliminated the function keyword from that line of code (and if input and filtersize were defined) it could be a valid call to the convolution1dLayer function.
This documentation page shows how to define functions (note that the "Input arguments" must be variable names not literal data) and this one shows how to call functions. You're trying to combine the two and that's not going to work.
0 Commenti
Vedere anche
Categorie
Scopri di più su Get Started with MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!