Neural Network
Started on implementing neural network from NNFS. I've done ReLU and stopped at p.104. Softmax is not ready.
This commit is contained in:
+37
-2
@@ -8,6 +8,8 @@
|
||||
#include "./modules/mesh/mesh.h"
|
||||
#include "modules/fluids/fluids.h"
|
||||
|
||||
#include "./modules/neural_networks/neural_networks.h"
|
||||
|
||||
|
||||
|
||||
//#include <iostream>
|
||||
@@ -19,7 +21,40 @@
|
||||
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
{
|
||||
|
||||
utils::Mf X(10,2, 0);
|
||||
utils::Vf y(10, 0);
|
||||
neural_networks::create_spital_data(100, 3, X, y);
|
||||
|
||||
neural_networks::dense_layer<float> layer(2, 3);
|
||||
|
||||
neural_networks::activation_ReLU<float> RelU;
|
||||
|
||||
layer.forward(X);
|
||||
RelU.forward(layer.outputs);
|
||||
|
||||
for (int i = 0; i < 5; ++i){
|
||||
std::cout << RelU.outputs.get_row(i) << std::endl;
|
||||
}
|
||||
|
||||
//layer1_output.print();
|
||||
//layer2_output.print();
|
||||
|
||||
//std::cout << output << std::endl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
utils::Vd a = utils::linspace<double>(1, 10, 10, true);
|
||||
a.print();
|
||||
mesh::Mesh1D<double> mesh(a);
|
||||
@@ -40,7 +75,7 @@ int main(int argc, char const *argv[])
|
||||
|
||||
fluids::Diffusion1D<double> diffusion(cfg, mesh, Gamma);
|
||||
diffusion.assemble(A, b, s);
|
||||
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user