new function to support LSTM Unit

This commit is contained in:
2016-01-27 23:40:32 +01:00
parent d424d87535
commit 3c26c9641c
7 changed files with 97 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
#include <NeuralNetwork/BasisFunction/Linear.h>
#include <NeuralNetwork/BasisFunction/Product.h>
#include <iostream>
#include <cassert>
@@ -33,6 +34,14 @@ int main() {
assert(220.0==l.computeStreaming(w,w));
assert(220.0==l.compute(w,w));
}
{
NeuralNetwork::BasisFunction::Product l;
std::vector<float> w({0,0.501,1});
std::vector<float> i({0,0.2,0.3});
assert(l(w,i) > 0.05999);
assert(l(w,i) < 0.06001);
}
/*
std::vector<float> w;
std::vector<float> i;
@@ -61,6 +70,5 @@ int main() {
std::cout << "SSE :" << diff.count() << " s\n";
}
*/
std::cout <<"OK" << std::endl;
}