mirror of https://github.com/AlexeyAB/darknet.git
Merge pull request #1 from AlexeyAB/master
Minor fix. Fixed forward MISH on CPU
This commit is contained in:
commit
d392cbc622
|
@ -61,7 +61,8 @@ static inline float selu_activate(float x) { return (x >= 0)*1.0507f*x + (x < 0)
|
|||
static inline float relie_activate(float x){return (x>0) ? x : .01f*x;}
|
||||
static inline float ramp_activate(float x){return x*(x>0)+.1f*x;}
|
||||
static inline float leaky_activate(float x){return (x>0) ? x : .1f*x;}
|
||||
static inline float tanh_activate(float x){return (expf(2*x)-1)/(expf(2*x)+1);}
|
||||
//static inline float tanh_activate(float x){return (expf(2*x)-1)/(expf(2*x)+1);}
|
||||
static inline float tanh_activate(float x) { return (2 / (1 + expf(-2 * x)) - 1); }
|
||||
static inline float softplus_activate(float x, float threshold) {
|
||||
if (x > threshold) return x; // too large
|
||||
else if (x < -threshold) return expf(x); // too small
|
||||
|
|
|
@ -266,6 +266,13 @@ void forward_network(network net, network_state state)
|
|||
l.forward(l, state);
|
||||
//printf("%d - Predicted in %lf milli-seconds.\n", i, ((double)get_time_point() - time) / 1000);
|
||||
state.input = l.output;
|
||||
|
||||
/*
|
||||
float avg_val = 0;
|
||||
int k;
|
||||
for (k = 0; k < l.outputs; ++k) avg_val += l.output[k];
|
||||
printf(" i: %d - avg_val = %f \n", i, avg_val / l.outputs);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,16 @@ void forward_network_gpu(network net, network_state state)
|
|||
cudaStreamSynchronize(get_cuda_stream());
|
||||
state.input = l.output_gpu;
|
||||
//cudaDeviceSynchronize();
|
||||
|
||||
/*
|
||||
cuda_pull_array(l.output_gpu, l.output, l.outputs);
|
||||
cudaStreamSynchronize(get_cuda_stream());
|
||||
float avg_val = 0;
|
||||
int k;
|
||||
for (k = 0; k < l.outputs; ++k) avg_val += l.output[k];
|
||||
printf(" i: %d - avg_val = %f \n", i, avg_val / l.outputs);
|
||||
*/
|
||||
|
||||
/*
|
||||
cuda_pull_array(l.output_gpu, l.output, l.batch*l.outputs);
|
||||
if (l.out_w >= 0 && l.out_h >= 1 && l.c >= 3) {
|
||||
|
|
Loading…
Reference in New Issue