Azzera filtri
Azzera filtri

What is the difference between net.inputWeights{i,j}=2 and net.inputW​eights{i,j​}.delays=[​1,2];

3 visualizzazioni (ultimi 30 giorni)
Hi there,
I want to implement a simple NARX model with input delay of lets say 2 time steps. I am confused about the meaning of net.inputWeights{i,j}=2 and net.inputWeights{i,j}.delays=[1,2]. They also apear different on the net viewer.

Risposte (1)

Saurabh
Saurabh il 11 Giu 2023
In a NARX network, the `inputWeights` property is a cell array that contains the weights for each input at each layer of the network. The weights are represented using a matrix in each cell of the `inputWeights` property. The dimensions of the matrix depend on the number of neurons in the input layer and the number of neurons in the layer to which the input is connected.
To specify a delay in an input, you can set the `delays` property of the input weight matrix. The `delays` property is a vector that specifies the time delay associated with each input neuron. Each element of the `delays` vector corresponds to a row of the input weight matrix and specifies the delay associated with that input neuron.
Here's an example:
% Create a feedforward network with one hidden layer
net = feedforwardnet([5]);
% Set the input delay for the first input (`i=1`) at the first layer (`j=1`)
net.inputWeights{1,1}.delays = [1,2];
In this example, we create a feedforward network with one hidden layer of five neurons. We then set the input delay for the first input, which is at the first layer, to be one time step and two time steps using the `delays` property of the input weight matrix.
The meaning of `net.inputWeights{i,j} = 2` is unclear, as the `inputWeights` property should be a cell array of weight matrices, not a scalar value. My guess is that this may indicate a syntax error in your code.
In the net viewer, the `inputWeights` property is represented as a matrix, with each row corresponding to a neuron in the input layer and each column corresponding to a neuron in the layer to which the input is connected. The values in the matrix represent the weight of each connection, with the `delays` property represented as annotations next to each neuron in the input layer.

Categorie

Scopri di più su Deep Learning Toolbox in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by