Skip to content

Commit

Permalink
add double BP to recurrent_example
Browse files Browse the repository at this point in the history
  • Loading branch information
josephjaspers committed Aug 3, 2019
1 parent 306872c commit 2377260
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions examples/mnist_test_recurrent/mnist_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ int percept_MNIST(System system_tag, const char* mnist_dataset,

//Truncate BP to only the last output
network.back_propagation(outputs[j]);
network.back_propagation(outputs[j]);

network.update_weights();
}
}
Expand Down
Binary file modified examples/mnist_test_recurrent/mnist_test_exec
Binary file not shown.
8 changes: 5 additions & 3 deletions include/neural_networks/Layer_Chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ namespace detail {
template<bool Recurrent, int Index, class Derived, class Layer>
using LayerManager =
std::conditional_t<Recurrent,
std::conditional_t<Index == 0,
Input_Layer_Manager<Derived, Layer>, //if first layer
Recurrent_Layer_Manager<Derived, Layer>>,

//TODO Add recurrent input layer_manager
// std::conditional_t<Index == 0,
// Input_Layer_Manager<Derived, Layer>, //if first layer
Recurrent_Layer_Manager<Derived, Layer>, //>,
std::conditional_t<Index == 0,
Input_Layer_Manager<Derived, Layer>, //if first layer
Layer_Manager<Derived, Layer>>>;
Expand Down
2 changes: 1 addition & 1 deletion include/neural_networks/Layers/Recurrent.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct Recurrent : public Layer_Base {

private:

ValueType lr = 0.03;
ValueType lr = 0.0003;

mat w; //weights
mat r;
Expand Down

0 comments on commit 2377260

Please sign in to comment.