GithubHelp home page GithubHelp logo

Comments (6)

Jannertje avatar Jannertje commented on July 17, 2024

First 3-point hierarchical basis introduces some sorting steps, as well as calling O(N) list.index() methods.

I optimized IndexSet a little; see fbe3328.

from spacetime.

Jannertje avatar Jannertje commented on July 17, 2024

Implementation works but the dot-product seems to become the bottleneck over time. If we track the computation time of apply() for the 3-point mass matrix on uniform grids with max level $l$, for $l = 1$ to $13$, then we get the following profiling results. Moreover, making a plot shows that for larger $l$, the total computation time becomes quadratic.. Hmm

ncalls tottime percall cumtime percall filename:lineno(function)
114882 10.004 0.000 10.580 0.000 indexed_vector.py:60(dot)
16369 6.500 0.000 6.526 0.000 three_point_basis.py:138(col)
32829 4.617 0.000 4.680 0.000 three_point_basis.py:115(row)
392843 0.655 0.000 1.395 0.000 index_set.py:43(neighbours)
392843 0.525 0.000 0.525 0.000 {built-in method _bisect.bisect_left}
180748 0.428 0.000 1.442 0.000 three_point_basis.py:179(scaling_support)
65476 0.288 0.000 1.220 0.000 three_point_basis.py:189(wavelet_support)
360651 0.285 0.000 0.285 0.000 indexed_vector.py:62()
490394 0.235 0.000 0.235 0.000 three_point_basis.py:22(position_ss)
114882 0.223 0.000 0.508 0.000 {built-in method builtins.sum}
393051 0.209 0.000 0.255 0.000 three_point_basis.py:257(scaling_indices_on_level)
246588 0.163 0.000 0.163 0.000 interval.py:4(init)
312 0.152 0.000 15.392 0.049 linear_operator.py:25()

from spacetime.

Jannertje avatar Jannertje commented on July 17, 2024

The problem seems to be in that while the matrices P and Q have a bounded number of nonzero elements per, the sets $\Pi_B$ and $\Lambda_l$ (the sets we restrict vectors to before applying P and Q) grow. As a result, the inner-product cost sum(self.vector[labda] * other[labda] for labda in index_mask & other.keys()) grows linearly in the size of other..

from spacetime.

Jannertje avatar Jannertje commented on July 17, 2024

More careful phrasing (sum(self.vector[labda] * other[labda] for labda in other.keys() if labda in index_mask)) made a big difference. It's now linear and runs a lot faster :-)

from spacetime.

Jannertje avatar Jannertje commented on July 17, 2024

The biggest hurdly to cross to making this truly linear time will be the computation of $\Pi_B$ and $\underline \Pi$. Maybe Rob can help shed some light on this.

from spacetime.

Jannertje avatar Jannertje commented on July 17, 2024

With the tree-implementation, this is no longer really a current topic. Closing for staleness.

from spacetime.

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.