* @param[in/out] Weight Weight Tensor
* @param[in/out] Bias Bias Tensor
* @param[in] iteration nth epoch number
- * @param[in] init_zero bool it is true if bias sets zero.
*/
void calculate(const Tensor &djdw, const Tensor &djdb, Tensor &weight,
- Tensor &bias, int iteration, bool init_zero);
+ Tensor &bias, int iteration);
/**
* @brief Property Enumeration
}
void Optimizer::calculate(const Tensor &djdw, const Tensor &djdb,
- Tensor &weight, Tensor &bias, int iteration,
- bool init_zero) {
+ Tensor &weight, Tensor &bias, int iteration) {
Tensor djdwAvg, djdbAvg;
float ll = popt.learning_rate;
if (popt.decay_steps != -1) {
switch (type) {
case OptType::sgd:
weight.add_i(djdwAvg, -ll);
+ bias.add_i(djdbAvg, -ll);
break;
case OptType::adam: {
std::function<float(float)> sqrtEps = [&](float f) {
default:
break;
}
-
- if (init_zero) {
- bias.add_i(djdbAvg, -ll);
- }
}
int Optimizer::setProperty(std::vector<std::string> values) {