mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
fix GRU, add LSTM
This commit is contained in:
parent
e9f3b79776
commit
604a760637
@ -546,6 +546,7 @@ list *read_cfg(char *filename);
|
||||
#include "dropout_layer.h"
|
||||
#include "gemm.h"
|
||||
#include "gru_layer.h"
|
||||
#include "lstm_layer.h"
|
||||
#include "im2col.h"
|
||||
#include "image.h"
|
||||
#include "layer.h"
|
||||
|
@ -185,7 +185,6 @@ void forward_gru_layer_gpu(layer l, network state)
|
||||
activate_array_ongpu(l.hh_gpu, l.outputs*l.batch, TANH);
|
||||
|
||||
weighted_sum_gpu(l.h_gpu, l.hh_gpu, l.z_gpu, l.outputs*l.batch, l.output_gpu);
|
||||
//ht = z .* ht-1 + (1-z) .* hh
|
||||
copy_ongpu(l.outputs*l.batch, l.output_gpu, 1, l.h_gpu, 1);
|
||||
|
||||
state.input += l.inputs*l.batch;
|
||||
|
@ -8,12 +8,12 @@
|
||||
|
||||
layer make_lstm_layer(int batch, int inputs, int outputs, int steps, int batch_normalize);
|
||||
|
||||
void forward_lstm_layer(layer l, network state);
|
||||
void forward_lstm_layer(layer l, network net);
|
||||
void update_lstm_layer(layer l, int batch, float learning, float momentum, float decay);
|
||||
|
||||
#ifdef GPU
|
||||
void forward_lstm_layer_gpu(layer l, network state);
|
||||
void backward_lstm_layer_gpu(layer l, network state);
|
||||
void forward_lstm_layer_gpu(layer l, network net);
|
||||
void backward_lstm_layer_gpu(layer l, network net);
|
||||
void update_lstm_layer_gpu(layer l, int batch, float learning_rate, float momentum, float decay);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user