Coder Social home page Coder Social logo

float division by zero about btmpy HOT 3 OPEN

jasperyang avatar jasperyang commented on July 29, 2024
float division by zero

from btmpy.

Comments (3)

amingjiang avatar amingjiang commented on July 29, 2024 2

you can change code in indexDocs.py line 18 and line 28 to this :

print(' '.join(map(str, wids)), file=wf)

print('%d\t%s' % (wid, w), file=wf)

from btmpy.

jasperyang avatar jasperyang commented on July 29, 2024

I don't know which line is this code, and i just can't exactly solve it.

from btmpy.

ZoeM2016 avatar ZoeM2016 commented on July 29, 2024

sorry,i didn't put it very clearly.this code is in pvec.py line99

def normalize(self,smoother=0.0):
s = self.sum()
assert(s>=0)
K = len(self.p)
for i in range(K):
self.p[i] = (self.p[i] + smoother)/(s + K*smoother)

when i run this, self.sum=0 and self.p=0

from btmpy.

Related Issues (8)

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.