Giter Site home page Giter Site logo

`inf` value for RMSE metric about openkiwi HOT 3 CLOSED

edufierro avatar edufierro commented on August 20, 2024
`inf` value for RMSE metric

from openkiwi.

Comments (3)

captainvera avatar captainvera commented on August 20, 2024

Hello @edufierro,

I have been trying to reproduce your error to no avail.
Can you try to reproduce this in your system and let me know If it happens again?

This error is happening in the RMSE metric code:

class RMSEMetric(Metric):
    def __init__(self, **kwargs):
        super().__init__(metric_name='RMSE', **kwargs)

    def update(self, batch, model_out, **kwargs):
        predictions = self.get_predictions_flat(model_out, batch)
        target = self.get_target_flat(batch)
        self.squared_error += ((predictions - target) ** 2).sum().item()
        self.tokens += self.get_tokens(batch)

    def summarize(self):
        rmse = math.sqrt(self.squared_error / self.tokens)
        summary = {self.metric_name: rmse}
        return self._prefix_keys(summary)

For the rmse to be infinite the division self.squared_error / self.tokens needs to be infinite. Since self.tokens = get_tokens can never be a decimal number, this must be caused by some kind of numerical errors when calculating the squared error.

Let me know if you can reproduce this error so we can get to the bottom of it!

from openkiwi.

edufierro avatar edufierro commented on August 20, 2024

Will do. Thanks @captainvera & team!

from openkiwi.

captainvera avatar captainvera commented on August 20, 2024

Hey @edufierro,
since we're not able to reproduce this issue I'll be closing it for now.
If you get this error again or find any way to reproduce it, please feel free to re-open this!

from openkiwi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.