LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Euclidean matrix distance for radial basis neural network

Solved!
Go to solution

Hi,

I am working on radial bases neural network in Labview. I've generated bias and weights in Matlab. I have a problem with implementing euclidean distance function beetwen two matrixes - input vector and first layer weights. There is something wrong with indexing. Output value doesnt change when I am changing inputs. Maybe someone knows what should I change in selected part. Weights matrix is 131x7 and input matrix is 7x1. Output matrix should be 131x1.

Kamila_Jankowska_0-1591978463375.png

 

0 Kudos
Message 1 of 23
(3,385 Views)

It is pointless to show an image with messy hidden wires and no way to tell what's in e.g. the array diagram constants. (e.g. How big is the array where we only see the "2". Maybe you want to replace that with a scalar constant instead?). I see a lot over overly complicated and unnecessary code that could be dramatically simplified. Many of your FOR loops are not needed. Maybe the "Nx1" 2D arrays should be 1D arrays instead.

 

Attach your actual VI, making sure that all controls have typical default data (and include the input files), then tell us the result you would expect.

0 Kudos
Message 2 of 23
(3,345 Views)

Things like constants its not a problem I can replace it or not it doesnt change anything. Without thoose for loops vector is smaller than it should be. I dont see any hidden wires and I wrote everything about size. 

0 Kudos
Message 3 of 23
(3,304 Views)

If you want help, you need to help us first. Nobody will try to recreate, debug, and test your code from a picture. Too much work and too ambiguous. Your wires go all over the place and there is no way to tell which input is connected to the top or bottom of the division because these wires are hidden behind it (as I already said).

 

If you really want help, attach the VI. Simple as that!

 


@Kamila_Jankowska wrote:

Without thoose for loops vector is smaller than it should be. 


You have at least 10 indicators and none is label "vector" Don't let us guess!. If "it" is smaller without the loops, why don't you show the code without the loops. Does that mean with the loops shown the size is correct???

0 Kudos
Message 4 of 23
(3,294 Views)

I need help with selected fragment. I dont want you to analyze all code and I said that.  I have to calculete euclidean distans from  every row of matrix 131x7 (w1) to intput vector 7x1 in this fragment. 

0 Kudos
Message 5 of 23
(3,290 Views)

Then attach a VI with the selected fragment!

 

Also make sure to define which of the dimension is # of rows and which is # of columns to avoid confusion.

0 Kudos
Message 6 of 23
(3,285 Views)

I get a "Distance" vector with 131 elements:

 

altenbach_0-1592030800316.png

 

0 Kudos
Message 7 of 23
(3,283 Views)

Kamila_Jankowska_0-1592031084644.png

I cant disable indexing in here. 

0 Kudos
Message 8 of 23
(3,278 Views)

Kamila_Jankowska_0-1592031630329.png

 

0 Kudos
Message 9 of 23
(3,274 Views)

@Kamila_Jankowska wrote:

 

I cant disable indexing in here. 


 

Of course you can and you already did!!! Since the array from the top is either 1 row or one column, get the correct 1D array using "index array" before the loop and don't index it at the loop boundary.

 

Autoindex on the matrix to get one row of 7 elements per iterations. Currently you don't.

 

You really should go back to the basic tutorials!

0 Kudos
Message 10 of 23
(3,273 Views)