Skip to content
Snippets Groups Projects

[Add] loss function system, MSE loss function, unit-test associated with MSE

Merged Maxence Naud requested to merge learning into dev
4 files
+ 191
2
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -52,7 +52,7 @@ public:
mReversedDampening.set<float>(0, 1.0f - dampening);
}
void update() override {
void update() override final {
mLR.setBackend(mParameters[0]->getImpl()->backend());
mLR.set<float>(0, learningRate());
if (mParameters[0]->getImpl()->backend() != mMomentum.getImpl()->backend()) {
@@ -74,7 +74,7 @@ public:
mLRScheduler.update();
}
void setParameters(const std::vector<std::shared_ptr<Tensor>>& parameters) {
void setParameters(const std::vector<std::shared_ptr<Tensor>>& parameters) override final {
Optimizer::setParameters(parameters);
mGradientInertia = std::vector<Tensor>(parameters.size());
for (std::size_t i = 0; i < parameters.size(); ++i) {
Loading