LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Euclidean matrix distance for radial basis neural network

Solved!
Go to solution

I will try it and thank you for your help. I am not going to ask about anything else. 

 

P.s. You really should keep calm. Labview is just one of the tool that I am using and it isnt necessery going back to the basics, especially when I dont have time for this. 

0 Kudos
Message 11 of 23
(1,643 Views)

@Kamila_Jankowska wrote:

P.s. You really should keep calm. Labview is just one of the tool that I am using and it isnt necessery going back to the basics, especially when I dont have time for this. 


I was extremely patient and three explanation points don't mean I am not calm. 🙂 Sometimes I put emphasis to clarify a point. Don't misinterpret it. If I don't like a thread, I would just walk away instead of trying to help.

 

You can't just randomly wire things up until things fit. If you don't have time to learn the basics, you shouldn't be programming at all! I am serious.

 

If you had attached a small VI with the problem when first asked, we could have solved it in one minute (A good thing since you "don't have time for this"). Instead we wasted about a day for nothing. It is very frustrating to get small bits of information one ambiguous post at a time.

 

Most readers here will just ignore this thread, while I am putting effort in to understand AND solve your problem working for free. Good luck!

Message 12 of 23
(1,638 Views)

@altenbach wrote:

 Many of your FOR loops are not needed.


For example you have code similar to this (top of image).

altenbach_0-1592034357404.png

 

Message 13 of 23
(1,633 Views)

@Kamila_Jankowska wrote:

I cant disable indexing in here. 

 

autoindexing is indeed a very basic labview skill, and it is okay to repeat basic knowledge from time to time.

 

the labview matrix is always a 2d array, even if you use only one column.

 

broken-matrix.PNG

a further basic question is:

in the following example the for loop is executed 2 times - not 3 times - why?

 

Message 14 of 23
(1,600 Views)

The matrix here is 131x7, but the W1 is a "pseudo 2D array", i.e. only one row or one column (but we cannot tell from the picture which!), but the required code critically depends on that knowledge.

 

Similarly, there is no way to tell the size and values of the array diagram constant on top of the loop stack because we can only see the first element (container size != array size!). The smaller of the two arrays going into the division determines the output size, but again it's impossible to reconstruct from a picture.

 

The chances of this ever to correctly work without doing some basic tutorials is about the same as piloting a fighter jet without ever taking flying lessons. Most likely (and hopefully) we never get off the ground, but if we do, it could get worse.... 😮

 

0 Kudos
Message 15 of 23
(1,589 Views)

Finally it works this way. I get the same answer as from matlab. Thanks everyone.

 

Kamila_Jankowska_0-1592131748956.png

 
 
 
 

 

 

0 Kudos
Message 16 of 23
(1,568 Views)

@Kamila_Jankowska wrote:

Finally it works this way. I get the same answer as from matlab. Thanks everyone.


 

Congratulations!

 

A few things can still be simplified:

 

  • You can combine the two FOR loops into one.
  • The ToDBL is not needed.
  • You could use a 1D array control instead of 7 scalar controls. (especially important if you later make this into a subVI and define connectors)
  • If you take the square of b1 first, you can eliminate the square-root and the second squaring (more efficient!)
  • You still have a right-to-left wire at b2
  • Wiring a chart (!) to a matrix makes absolutely no sense, especially since there is no toplevel loop. Do you know the difference between a chart and a graph?
  • We still don't know which of the 2D arrays are actually 1D vectors (1 row or one column). If we would know, more simplifications are possible.
  • ...

 

I know you will ignore me when I ask you to attach your VI final and typical data, but I would like to do a few tests on it. I would really appreciate if you could attach it.

0 Kudos
Message 17 of 23
(1,538 Views)

You have no idea what I am using it for, so how can you know what makes sense.  The output is one value and user can see every answner of neural network.  This is the part of application when I have 3 types of neural networks RBF, MLP and SOM. User define inputs by this controls. This the way how I want it. Without this dbl the anwsner isnt the same as matlab's one. It is not coding for coding. It just has to work. I have a practice that I am making mess till something work and I am cleaning up when it does. I know it is not a good thing. 

Of course I can attache my VI. Stop acting like you know what I will do.

Message 18 of 23
(1,526 Views)

@Kamila_Jankowska wrote:

You have no idea what I am using it for, so how can you know what makes sense.


I assume you are talking about the chart comment.

 

There is no way to tell from looking at the code picture that your 2D array is actually just one single point. 😮

 

A chart has a fixed size history buffer and accumulates consecutive results, dropping the oldest when the buffer is full. It is typically used  with scalar inputs, appending one set of points to the existing data such as in a temperature recorder. If you send it 2D data, every call gives you a block of traces where it might be hard to tell where the previous data ends and the new data begins. If the wired data dimensions are larger than the history buffer, some data is irreversibly lost.

 

Still, if your 2D array is a single value, why don't you make it a scalar before wiring to the chart?

 

 

Thanks for the VI. (Please don't use unusual characters in the file name. I cannot open it on English windows unless I rename the file and remove that "accented c". See also Rolf's comments in this disucssion)

Do you also have the various small data files so I can see how the data is arranged?

What are typical values for the scalar controls? (Do you know that you can make typical values the default before saving?)

 

It is highly recommended to use standard connector panes (style guide! "API Design checklist" section here). As I said, all you need is a 1D array instead of these 7 scalars. A connector pane with tons of connectors makes wiring difficult and makes miss-wiring much more likely). Why would you need two assigned outputs ( a 2D array and a matrix!) for the same (apparently scalar!) value?). Seems redundant.

 

All you really need is two array inputs (array of 4 paths, array of 7 DBLs) and a scalar DBL output.

 

 

 

altenbach_0-1592158585146.png

 

0 Kudos
Message 19 of 23
(1,520 Views)

Text files from Matlab for you 🙂 show me if you come up with something interesting. I know I can add default values but it has no sense in here. 

 

'Still, if your 2D array is a single value, why don't you make it a scalar before wiring to the chart?'

Because it doesnt change anything in this application.

bin_RBF - b1 (in biases)

bout_RBF - b2 (out biases)

 

And thank you for all advises.

Download All
0 Kudos
Message 20 of 23
(1,489 Views)