From c52fa4742866125e35e88d0653dac99473e5fffb Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 16 Apr 2018 10:09:10 +0000
Subject: [PATCH] Loss-graph store automatically (iterations == max_batches) at the end of training
---
src/crnn_layer.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/crnn_layer.c b/src/crnn_layer.c
index 5d5fa63..5495880 100644
--- a/src/crnn_layer.c
+++ b/src/crnn_layer.c
@@ -48,23 +48,31 @@
l.input_layer = malloc(sizeof(layer));
fprintf(stderr, "\t\t");
- *(l.input_layer) = make_convolutional_layer(batch*steps, h, w, c, hidden_filters, 3, 1, 1, activation, batch_normalize, 0, 0);
+ *(l.input_layer) = make_convolutional_layer(batch*steps, h, w, c, hidden_filters, 3, 1, 1, activation, batch_normalize, 0, 0, 0);
l.input_layer->batch = batch;
l.self_layer = malloc(sizeof(layer));
fprintf(stderr, "\t\t");
- *(l.self_layer) = make_convolutional_layer(batch*steps, h, w, hidden_filters, hidden_filters, 3, 1, 1, activation, batch_normalize, 0, 0);
+ *(l.self_layer) = make_convolutional_layer(batch*steps, h, w, hidden_filters, hidden_filters, 3, 1, 1, activation, batch_normalize, 0, 0, 0);
l.self_layer->batch = batch;
l.output_layer = malloc(sizeof(layer));
fprintf(stderr, "\t\t");
- *(l.output_layer) = make_convolutional_layer(batch*steps, h, w, hidden_filters, output_filters, 3, 1, 1, activation, batch_normalize, 0, 0);
+ *(l.output_layer) = make_convolutional_layer(batch*steps, h, w, hidden_filters, output_filters, 3, 1, 1, activation, batch_normalize, 0, 0, 0);
l.output_layer->batch = batch;
l.output = l.output_layer->output;
l.delta = l.output_layer->delta;
+ l.forward = forward_crnn_layer;
+ l.backward = backward_crnn_layer;
+ l.update = update_crnn_layer;
+
#ifdef GPU
+ l.forward_gpu = forward_crnn_layer_gpu;
+ l.backward_gpu = backward_crnn_layer_gpu;
+ l.update_gpu = update_crnn_layer_gpu;
+
l.state_gpu = cuda_make_array(l.state, l.hidden*batch*(steps+1));
l.output_gpu = l.output_layer->output_gpu;
l.delta_gpu = l.output_layer->delta_gpu;
--
Gitblit v1.10.0