Giter VIP home page Giter VIP logo

Comments (9)

soumith avatar soumith commented on August 15, 2024

wow, that's a big catch.

from torch7.

soumith avatar soumith commented on August 15, 2024

Bug is from THDiskFile.c line 308ish

Default print and scan precision of fscanf and fprint is 6 digits (actually there's no standard I think).

It's better if we use %a for fprintf and fscanf so that the results will be exact.

from torch7.

soumith avatar soumith commented on August 15, 2024

but I cant send in a simple pull request to fix this, because it would break existing saved files.
@andresy needs to create a new version for the serialization format.

from torch7.

koraykv avatar koraykv commented on August 15, 2024

I don't think ascii is appropriate for conserving precision. This could cause the size of exported files to explode. Isn't it better to use binary format if you want to conserve full precision? It is faster to read/write and much smaller file size.

from torch7.

soumith avatar soumith commented on August 15, 2024

Ascii is needed for cross-platform compatibility (see other issues wrt
torch's big-endian/little-endian incompatibility). Ascii can have exact
precision with the %a fprintf formatter without taking up too much space.

On Thu, Feb 27, 2014 at 4:07 PM, koray kavukcuoglu <[email protected]

wrote:

I don't think ascii is appropriate for conserving precision. This could
cause the size of exported files to explode. Isn't it better to use binary
format if you want to conserve full precision? It is faster to read/write
and much smaller file size.

Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-36229316
.

from torch7.

andresy avatar andresy commented on August 15, 2024

Note sure what to do here.

  • I could augment the default precision with %g (or switch to %f) (but how much precision would that be?)
  • I could add a method to set the default precision (infinite would be with %a)

from torch7.

soumith avatar soumith commented on August 15, 2024

%a would be ideal but it is not C89. So maybe increasing the precision a bit makes sense.

from torch7.

soumith avatar soumith commented on August 15, 2024

%f by default would be 6 digits I think unless you specify explicit number of digits to pick up for decimal and fractional parta

from torch7.

clementfarabet avatar clementfarabet commented on August 15, 2024

Increasing the precision is probably enough at this point. Maybe twice as much as we have now?

from torch7.

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.