Save
Maybe backward on activation+loss works
This commit is contained in:
@@ -112,6 +112,33 @@ struct loss{
|
||||
const panic::tensor::real_matrix& y_pred,
|
||||
const panic::tensor::real_matrix& y_true);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Virtual backward function for derivative loss functions
|
||||
*
|
||||
* @param y_pred Matrix of model predection.
|
||||
* @param y_true Vector of true label of data.
|
||||
*
|
||||
* @Note If the derivatived object does not use this,
|
||||
* it returns false.
|
||||
*/
|
||||
virtual bool backward(
|
||||
const panic::tensor::real_matrix& y_pred,
|
||||
const panic::tensor::uint_vector& y_true);
|
||||
|
||||
/**
|
||||
* @brief Virtual backward function for derivative loss functions
|
||||
*
|
||||
* @param y_pred Matrix of model predection.
|
||||
* @param y_true Matrix of true label of data.
|
||||
*
|
||||
* @Note If the derivatived object does not use this,
|
||||
* it returns false.
|
||||
*/
|
||||
virtual bool backward(
|
||||
const panic::tensor::real_matrix& y_pred,
|
||||
const panic::tensor::real_matrix& y_true);
|
||||
|
||||
/**
|
||||
* @brief Virtual calculate function that calculates the loss
|
||||
*
|
||||
|
||||
@@ -67,7 +67,7 @@ struct loss_categorical_crossentropy: loss{
|
||||
*/
|
||||
bool forward(
|
||||
const panic::tensor::real_matrix& y_pred,
|
||||
const panic::tensor::uint_vector& y_true);
|
||||
const panic::tensor::uint_vector& y_true)override;
|
||||
|
||||
/**
|
||||
* @brief forward function to calculate losses
|
||||
@@ -80,7 +80,7 @@ struct loss_categorical_crossentropy: loss{
|
||||
*/
|
||||
bool forward(
|
||||
const panic::tensor::real_matrix& y_pred,
|
||||
const panic::tensor::real_matrix& y_true);
|
||||
const panic::tensor::real_matrix& y_true)override;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user