learn_to_drive: add up threshold in reLU to avoid NaN in neuron weight calc
This commit is contained in:
@@ -2,14 +2,16 @@
|
|||||||
|
|
||||||
char *action_name[8] = {"LEFT", "CENTER", "RIGHT"};
|
char *action_name[8] = {"LEFT", "CENTER", "RIGHT"};
|
||||||
|
|
||||||
|
#define THRESHOLD_UP 10
|
||||||
|
|
||||||
float reLU(float x){
|
float reLU(float x){
|
||||||
// if(x>10) return 10;
|
if(x>THRESHOLD_UP) return THRESHOLD_UP;
|
||||||
if(x>0) return x;
|
if(x>0) return x;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
float d_reLU(float x){
|
float d_reLU(float x){
|
||||||
// if (x>10) return 0;
|
if (x>THRESHOLD_UP) return 0;
|
||||||
if (x>0) return 1;
|
if (x>0) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user