Optimazation is done
This commit is contained in:
@@ -56,6 +56,8 @@ namespace panic{
|
||||
*/
|
||||
struct optimizer{
|
||||
|
||||
panic::types::real_t current_learning_rate;
|
||||
|
||||
/**
|
||||
* @brief Default de-constructor
|
||||
*
|
||||
@@ -64,15 +66,33 @@ struct optimizer{
|
||||
|
||||
|
||||
/**
|
||||
* @brief Virtual forward function for derivative layers
|
||||
* @brief Virtual update parameters function for derivative optimizers
|
||||
*
|
||||
* @param inputs Data matrix input for forward function.
|
||||
* @param layer trainable layer to have their parameters updated
|
||||
*
|
||||
* @Note It's equal to 0 because it make the derivative
|
||||
* object NEEDS to have these function to work.
|
||||
*/
|
||||
virtual bool update_params(trainable_layer& layer) = 0;
|
||||
|
||||
/**
|
||||
* @brief Virtual function to update internal parameters before update_params()
|
||||
*
|
||||
*
|
||||
*/
|
||||
virtual bool pre_update_params(){
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Virtual function to update internal parameters after update_params()
|
||||
*
|
||||
*
|
||||
*/
|
||||
virtual bool post_update_params(){
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user