Added LSTM sequence detector, and blur data augmentation (for OpenCV only)

This commit is contained in:
AlexeyAB
2019-05-06 00:01:56 +03:00
parent cce34712f6
commit 31dc6c8680
25 changed files with 316 additions and 40 deletions

View File

@ -85,6 +85,8 @@ layer make_crnn_layer(int batch, int h, int w, int c, int hidden_filters, int ou
l.delta_gpu = l.output_layer->delta_gpu;
#endif
l.bflops = l.input_layer->bflops + l.self_layer->bflops + l.output_layer->bflops;
return l;
}
@ -128,6 +130,16 @@ void resize_crnn_layer(layer *l, int w, int h)
#endif
}
void free_state_crnn(layer l)
{
int i;
for (i = 0; i < l.outputs * l.batch; ++i) l.self_layer->output[i] = rand_uniform(-1, 1);
#ifdef GPU
cuda_push_array(l.self_layer->output_gpu, l.self_layer->output, l.outputs * l.batch);
#endif // GPU
}
void update_crnn_layer(layer l, int batch, float learning_rate, float momentum, float decay)
{
update_convolutional_layer(*(l.input_layer), batch, learning_rate, momentum, decay);