added generic parameter for sigmoid function
This commit is contained in:
parent
b17888d0b4
commit
141ccae1dd
1 changed files with 9 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// eoSigBinaryFlight.h
|
// eoSigBinaryFlight.h
|
||||||
// (c) OPAC 2007
|
// (c) OPAC 2007, INRIA Futurs DOLPHIN
|
||||||
/*
|
/*
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
Contact: thomas.legrand@lifl.fr
|
Contact: thomas.legrand@lifl.fr
|
||||||
|
clive.canape@inria.fr
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -47,7 +48,8 @@ public:
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
eoSigBinaryFlight (){}
|
eoSigBinaryFlight (){slope = 1;}
|
||||||
|
eoSigBinaryFlight (unsigned _slope){slope = _slope;}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -55,7 +57,7 @@ public:
|
||||||
*/
|
*/
|
||||||
double sigmoid( double _value)
|
double sigmoid( double _value)
|
||||||
{
|
{
|
||||||
return(1/(1+ exp(- _value)));
|
return(1/(1+ exp(- _value/slope)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,6 +81,10 @@ public:
|
||||||
// invalidate the fitness because the positions have changed
|
// invalidate the fitness because the positions have changed
|
||||||
_po.invalidate();
|
_po.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private :
|
||||||
|
unsigned slope;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue