forked from AlexeyAB/darknet
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So there WAS this huge bug. Gone now
- Loading branch information
Showing
22 changed files
with
752 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
typedef enum{ | ||
SIGMOID, RELU, LINEAR, RAMP, TANH | ||
}ACTIVATION; | ||
|
||
float activate(float x, ACTIVATION a, float dropout) | ||
{ | ||
//if((float)rand()/RAND_MAX < dropout) return 0; | ||
switch(a){ | ||
case LINEAR: | ||
return linear_activate(x)/(1-dropout); | ||
case SIGMOID: | ||
return sigmoid_activate(x)/(1-dropout); | ||
case RELU: | ||
return relu_activate(x)/(1-dropout); | ||
case RAMP: | ||
return ramp_activate(x)/(1-dropout); | ||
case TANH: | ||
return tanh_activate(x)/(1-dropout); | ||
} | ||
return 0; | ||
} | ||
|
||
__kernel void activate_array(__global float *x, | ||
const int n, const ACTIVATION a, const float dropout) | ||
{ | ||
int i = get_global_id(0); | ||
x[i] = activate(x[i], a, dropout); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "mini_blas.h" | ||
|
||
void axpy_cpu(int N, float ALPHA, float *X, int INCX, float *Y, int INCY) | ||
{ | ||
int i; | ||
for(i = 0; i < N; ++i) Y[i*INCY] += ALPHA*X[i*INCX]; | ||
} | ||
|
||
void scal_cpu(int N, float ALPHA, float *X, int INCX) | ||
{ | ||
int i; | ||
for(i = 0; i < N; ++i) X[i*INCX] *= ALPHA; | ||
} | ||
|
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.