Code Monkey home page Code Monkey logo

Comments (6)

sccolbert avatar sccolbert commented on July 20, 2024

This is expected behavior, because there is not enough difference in the weights/strengths to express your intent. Instead of using hand-coded numerical strengths, try using the predefined strengths, which have sufficient delta that they wont trample each other:
https://github.com/nucleic/kiwi/blob/master/kiwi/strength.h#L28-L34

For performance, stengths/weights are not treated with pure lexographic ordering. Instead they are converted to a sufficiently large number base so that strengths of a lower order will not effect strengths of a higher order.

In the end, a strength is just a multiplier on an error term, and the solver minimizes the error. The difference between 500 and 501 is not sufficient to make the error for the 100 solution be larger than the error for the 90 solution. However, the difference between 500 and 511 is (for this case).

Note that the difference between each of the three weak, medium, strong built in strengths is three orders of magnitude.

from kiwi.

cacaodev avatar cacaodev commented on July 20, 2024

Thanks a lot, i have been able to get the correct result when using different strengths.

In case we need more than the 3 levels available (it is my case), I wonder is there is a way to calculate the minimum distance between levels to avoid that they clash each other.

from kiwi.

sccolbert avatar sccolbert commented on July 20, 2024

There's not a really way to do that, since it depends on how large the error is for the associated terms, and that varies based on the system of constraints which is being solved. The right way to solve it, would be to fully lexographic order the strengths internally. But as I mentioned, that way would be much slower than what we currently do.

from kiwi.

sccolbert avatar sccolbert commented on July 20, 2024

Your case may be fine by picking a 4 strength in the middle of the two you care about, or creating some other set of 4 (or more) strengths with sufficient distance between them.

from kiwi.

cacaodev avatar cacaodev commented on July 20, 2024

I created sub-strengths but I was getting conflicts between them. The solution for me was to just generate numbers corresponding to new strengths higher than strong and with the same order of magnitude x1000 . Of course I had to redefine required higher.

from kiwi.

MatthieuDartiailh avatar MatthieuDartiailh commented on July 20, 2024

Closing as the primary issue is fixed.

from kiwi.

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.