Giter Club home page Giter Club logo

beauty-of-roots's People

Contributors

alexander-0x80 avatar zemora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

beauty-of-roots's Issues

Performance to slow

Hi Alexander: thanks for your code.

I run roots.py on my computer and when the degree is larger than 20 it got very slow. for degree >= 22 it's expected to run a whole day.

I saw you used a list and append the roots to it, and list will get reallocated many times, I think this is the bottleneck in the performance.

May be you should declare a numpy array of size degree * 2**degree, and assign roots to this array. It runs much faster on my computer (45mins for d=22)

Another tip: when assigning HSV colors to the img, you used two for loops and this can be simplified further. np.where( Z > 0) would find the elements in Z that are >0, and then one can do vectorized arithmetic on Z then. the hsv_to_rgb() function in colorsys does not support vectorized arithmetic, but the function with the same name in matplotlib.colors does, and the color map "afmhot" does exactly the coloring scheme you did in plot.py.

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.