mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
checkpoint
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
#include "math.h"
|
||||
|
||||
typedef enum{
|
||||
LOGISTIC, RELU, RELIE, LINEAR, RAMP, TANH, PLSE, LEAKY, ELU, LOGGY, STAIR, HARDTAN
|
||||
LOGISTIC, RELU, RELIE, LINEAR, RAMP, TANH, PLSE, LEAKY, ELU, LOGGY, STAIR, HARDTAN, LHTAN
|
||||
}ACTIVATION;
|
||||
|
||||
ACTIVATION get_activation(char *s);
|
||||
@ -47,6 +47,18 @@ static inline float plse_activate(float x)
|
||||
return .125*x + .5;
|
||||
}
|
||||
|
||||
static inline float lhtan_activate(float x)
|
||||
{
|
||||
if(x < 0) return .001*x;
|
||||
if(x > 1) return .001*(x-1) + 1;
|
||||
return x;
|
||||
}
|
||||
static inline float lhtan_gradient(float x)
|
||||
{
|
||||
if(x > 0 && x < 1) return 1;
|
||||
return .001;
|
||||
}
|
||||
|
||||
static inline float hardtan_gradient(float x)
|
||||
{
|
||||
if (x > -1 && x < 1) return 1;
|
||||
|
Reference in New Issue
Block a user