Softmax + Categorical Crossentropy
I fixed the activation+loss function, you can't select it directly, it automaticly uses it if it can. I also fixed one-hot generator. Still haven't tested the activation + loss nor any other backward function. I'll do that when I get to the optimizers which is next.
This commit is contained in:
@@ -44,6 +44,14 @@ namespace panic{
|
||||
|
||||
|
||||
|
||||
enum struct layer_type {
|
||||
unknown,
|
||||
layer_dense,
|
||||
activation_relu,
|
||||
activation_softmax
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief Base layer for the rest of the neural network library to use
|
||||
*
|
||||
@@ -85,6 +93,16 @@ struct layer{
|
||||
virtual ~layer() = default;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Virtual layer_type function for derivative layers
|
||||
*
|
||||
* @Note This returns the type of layer it is
|
||||
* unknown be default
|
||||
*/
|
||||
virtual layer_type get_type() const {
|
||||
return layer_type::unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Virtual forward function for derivative layers
|
||||
*
|
||||
@@ -103,7 +121,7 @@ struct layer{
|
||||
* @Note It's equal to 0 because it make the derivative
|
||||
* object NEEDS to have these function to work.
|
||||
*/
|
||||
virtual bool backward(const panic::tensor::real_matrix& dinputs) = 0;
|
||||
virtual bool backward(const panic::tensor::real_matrix& dvalues) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user