Trying to fix nan output of RL by using relu with upperbound

This commit is contained in:
2024-07-16 12:13:05 +02:00
parent 0c9813beca
commit aac7434346
13 changed files with 405 additions and 75 deletions
+3 -2
View File
@@ -150,10 +150,11 @@ int copy_tensor_##type(tensor_##type * dst, tensor_##type * src){\
}\
}\
void init_random_x_##type(tensor_##type *M, type minR, type maxR, int randomRange){\
srand(time(NULL));\
/*static bool initRandomFirst = true;\
if(initRandomFirst){ srand(time(NULL)); initRandomFirst = false;}*/\
int randVal;\
for(size_t i =0; i<(M->dim)->rank;++i){\
randVal = rand() % randomRange;\
randVal = xrand() % randomRange;\
M->x[i]=minR + (maxR-minR)*randVal / randomRange ;\
\
}\