Activation Softmax Forward done
This commit is contained in:
@@ -50,14 +50,14 @@
|
||||
|
||||
#include <math/mul.hpp>
|
||||
#include <math/clip.hpp>
|
||||
#include <neural_network/activation/activation_ReLU.hpp>
|
||||
#include <neural_network/activation/activation_relu.hpp>
|
||||
#include <tensor/generators/linspace.hpp>
|
||||
#include <math/trigonometry/sin.hpp>
|
||||
#include <neural_network/datasets/sine_data.hpp>
|
||||
#include <neural_network/datasets/spiral_data.hpp>
|
||||
#include <neural_network/datasets/vertical_data.hpp>
|
||||
#include <math/exp.hpp>
|
||||
|
||||
#include <math/sub.hpp>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@@ -708,24 +708,33 @@ int main(void) {
|
||||
panic::tensor::real_matrix X;
|
||||
panic::tensor::uint_vector y;
|
||||
|
||||
panic::types::uint_t samples = 100;
|
||||
panic::types::uint_t samples = 10;
|
||||
panic::types::uint_t classes = 3;
|
||||
|
||||
|
||||
// create spiral data
|
||||
panic::neural_network::spiral_data(samples, classes, X, y);
|
||||
|
||||
// Initilise my model
|
||||
panic::neural_network::model mymodel;
|
||||
|
||||
// Create Dense layer with 2 input features and 3 output values
|
||||
mymodel.add_layer_dense(2,3);
|
||||
|
||||
mymodel.add_activation_ReLU();
|
||||
// Create an activation ReLU layer
|
||||
mymodel.add_activation_relu();
|
||||
|
||||
// Create a second dense layer with 3 inputs and 3 outputs
|
||||
mymodel.add_layer_dense(3, 3);
|
||||
|
||||
// Create activation softmax layer
|
||||
mymodel.add_activation_softmax();
|
||||
|
||||
mymodel.forward(X);
|
||||
|
||||
//panic::io::print_matrix(mymodel.outputs);
|
||||
panic::io::print_matrix(mymodel.outputs);
|
||||
|
||||
|
||||
std::cout << panic::math::exp(15.5f) << std::endl;
|
||||
std::cout << std::exp(15.5) << std::endl;
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user