Discussion of article "Self-organizing feature maps (Kohonen maps) - revisiting the subject" - page 4

 
Vladimir Karputov:
  1. The combinations ("0", "11", "12", "21", "22") I just gave you an example today. I have no idea whether they work or not. That's what I'm asking - if I come up with all sorts of combinations, how will the grid help me? I thought that this grid will show visually (number?) of hits of my examples in certain groups (clusters?).
  2. Well, if I make "... for example, the difference between Open[i]-Close[i] in one column, and the difference between Open[i+1]-Close[i+1] in another column, ..." what's the feedback? Well, I'll see different colours - but which one is which?


Everything is transparent there, there is program access to each node, you can both get the data of a node, and by giving a grid example to get which node responds to the example.

Study the article more carefully. Map visualisation is just an additional output of information, there are examples in the article where there is no visualisation, but the network does its job properly.

 

Hello, I get an error when compiling:

  • 'SOM_Net_Base.mqh' SOM_Net_Base.mqh 1 1
  • 'SOMNode.mqh' SOMNode.mqh 1 1
  • cannot cast 'Conversion_Double' to 'Conversion_UChar' SOM_Net_Base.mqh 115 21
  • 1 error(s), 0 warning(s) 2 1

      for(int i=0;i<count_double;i++)
        {
         c_uchar[i]=(Conversion_UChar) c_double[i];
         for(int j=0;j<8;j++) {txtdownl[dcnt]=c_uchar[i].c[j]; dcnt++;}
        }

For some reason, the data type is not being converted

struct Conversion_Double { double d; };

to type

struct Conversion_UChar  { uchar  c[8];};


 
Andrey Litvichenko:

Hello, it gives an error when compiling:

#include <TypeToBytes.mqh> // https://www.mql5.com/en/code/16280

      for(int i=0;i<count_double;i++)
        {
         _W(c_uchar[i])=c_double[i];
         for(int j=0;j<8;j++) {txtdownl[dcnt]=c_uchar[i].c[j]; dcnt++;}
        }


Can you replace the whole piece of original code

      ArrayResize(c_uchar,count_double);
      uchar txtdownl[]; ArrayResize(txtdownl,count_double*8);
      int dcnt=0;
      for(int i=0;i<count_double;i++)
        {
         c_uchar[i]=(Conversion_UChar)c_double[i];
         for(int j=0;j<8;j++) {txtdownl[dcnt]=c_uchar[i].c[j]; dcnt++;}
        }
      string txt_titles=CharArrayToString(txtdownl);  Print(txt_titles);


replace it with this

      string txt_titles=NULL;
      _W(txt_titles) = c_double;  Print(txt_titles);
 
Andrey Litvichenko:

Hello, I get an error when compiling:

  • 'SOM_Net_Base.mqh' SOM_Net_Base.mqh 1 1
  • 'SOMNode.mqh' SOMNode.mqh 1 1
  • cannot cast 'Conversion_Double' to 'Conversion_UChar' SOM_Net_Base.mqh 115 21
  • 1 error(s), 0 warning(s) 2 1

For some reason, the data type is not being converted

to type



By design, it should not be converted. It gives a warning and not anerror, don't pay attention, it should be like that.

When you transfer data from one structure to another without type conversion, binary data are transferred, not their decimal mapping, which is required in this example.

This is not a bug, but a feature.

 
Nikolay Demko:

It's not supposed to convert. It gives warning, not error, don't pay attention, it should be so.

When you transfer data from one structure to another without type conversion, binary data are transferred, not their decimal mapping, which is required in this example.

This is not a bug, but a feature.


That's the point: it generates an error and refuses to compile:

  • 1 error(s), 0 warning(s) 2 1
 
The rules of type conversion have changed "slightly" there)
 
fxsaber:


Could you replace the entire piece of original code


can be replaced with this.


And the _W operatorwill work for the reverse conversion, i.e. for

_W(c_double[i])=c_uchar[i];

?

 
Andrey Litvichenko:

And the _W operatorwill work for the inverse transformation, i.e. for

?

Yes, both ways. Here are examples.

 
fxsaber:

Yes, both ways. Here are some examples.


Thanks, it's working

 

Good afternoon,

Unfortunately, I accessed the article late, now there are obviously missing files in the archive

CSOM_Net_Base,
CSOM_Net_Train

Is it a glitch or access restriction?