"New Neural" is an Open Source neural network engine project for the MetaTrader 5 platform. - page 40

 

These are functions for the coefficients of the sigmoid angle of attack:

//+------------------------------------------------------------------+
double ytrans0(double y=0.5)// [0;0.5;1] --> [0;1;500.5] гипербола с перегибом в 0.5
  {
   double x=line0(y);
   return(x>0.5005?0.5005/(1.001-x):x*2.);
  }
//+------------------------------------------------------------------+
double ytrans1(double y=0.)// [-1;0;1] --> [0;1;500.5] сдвинутая гипербола с перегибом в 0.0
  {
   double x=(line1(y)+1.)/2.;
   return(x>0.5005?0.5005/(1.001-x):x*2.);
  }
//+------------------------------------------------------------------+

Let me explain why I wrote this:

task: it is necessary to regulate angle of sigmoid attack by neuron outputs themselves, outputs within [0;1] or [-1;1].

Let us consider the variant with [0;1]. On the section from 0 to 0.5 we need to decrease the angle of attack, which leads to a drop in the output temperature, on the section from 0.5 to 1, on the contrary, the angle should increase, but the main thing is smoothness and without transitions.

You need a hyperbola with an inflection at a given midpoint. You must use only one output to control angle of attack, or handle several outputs as arithmetic average, otherwise there will be locking towards the angle that emits the threshold function.

HZZ If the given inputs are used, then line0() and line1() are not needed, but then ytrans1() needs a shift to input range [0;1].

 
TheXpert:

By the way.

We need a sigmoid function.

The requirements -- a normal form of the function itself and its derivative (not too hard to calculate) and a normal form of the inverse function and its derivative.

These are the inverse of the sigmoid function above.

//+------------------------------------------------------------------+
double Invsigma0(double c)//  вход [0;1] обратные
  {
   return(-log((1.-c)/c));
  }
//+------------------------------------------------------------------+
double Invsigma1(double c)//  вход [-1;1]
  {
   return(-log((1.-c)/(1.+c)));
  }
//+------------------------------------------------------------------+
double Dsigma0(double c)//  вход [0;1] производные
  {//exp(-c)/(1+exp(-c))^2
   double e=exp(-c);
   double c2=1.+e;
   return(e/(c2*c2));
  }
//+------------------------------------------------------------------+
double Dsigma1(double c)//  вход [-1;1]
  {// (2*E^-c)/(1+E^-c)^2 
   double e=exp(-c);
   double c2=1.+e;
   return(2.*e/(c2*c2));
  }
//+------------------------------------------------------------------+
double DInvsigma0(double c)// вход [0;1] производные обратной сигмы
  {
   return(1./(c-c*c));
  }
//+------------------------------------------------------------------+
double DInvsigma1(double c)// вход [-1;1]
  {
   return(-2./(c*c-1.));
  }
//+------------------------------------------------------------------+

but the second one needs a check, otherwise you can run into #IND

ZZY I did not check, everything must be checked in order not to run into #IND

ZZZY Sorry forgot the square, corrected.

 
Urain:
All 4 functions must be defined for all X
 
Urain:

This is the inverse of the above sigmoid function.

but the second one needs a check, otherwise you might run into #IND


Insert something like this into the function:

if(x>0.9999999)
x=1.0;
if(x<-0.9999999)
x=-1.0;
 
joo:

Put something like this in the function:

It's possible to call linear activators, there's no need to mess up confusing formulas as it is.

ZY 39 page, last two functions line0() and line1().

ZZY added another function on page 39 to check Mline() for excess -#IND #IND

 
Stupid.
 
TheXpert:


?

 

Why? I like it.

I take it there's no question of a name?

 
TheXpert:

Why? I like it.

I guess the name isn't an issue anymore?

))

In the process of development everything will change a hundred times, as always.

 

Everything seems to be cool, but something is either wrong or unnecessary or missing...

And it's unclear why, because on closer inspection, you can't make any difference.

Do you have a separate head?

Or you need to sleep it off. Which I'm going to do now. And tomorrow I'm going for pike.