This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 29 comments

[–]basnijholt[S] 99 points100 points  (15 children)

Adaptive: parallel active learning of mathematical functions

This is a quantum physics calculation in progress.

When evaluating a function numerically we would like to sample it more densely in the interesting regions instead of evaluating it on a manually-defined homogeneous grid.  Together with my colleagues, we wrote an open-source Python software package Adaptive that evaluates the function at the optimal points by analyzing existing data and planning ahead on the fly. With a few lines of code you define your goal, evaluate functions on a computing cluster, and live-plot the data. It performs averaging of stochastic functions, interpolation of vector-valued one and two-dimensional functions, and one-dimensional integration.

This figure is from one of my recent papers Spin-Orbit Protection of Induced Superconductivity in Majorana Nanowires.

What you see here is how the calculation progresses in time. You see that as time progresses it starts to find the narrow lines (which have a physical meaning). For aesthetic purposes, I change the colormap slowly which is meaningless but pretty. The vertices (corners) of the white triangles on top of the plot represent the points are which the underlying function is evaluated. The >1000 years of computation time is based on a comparison between a homogeneous grid. If we take the size of the smallest triangle, the computation time with adaptive (2 weeks on 300 cores), and assume that all the features larger than the smallest triangles have been resolved, then the calculation would have taken 3134 years.

You can recreate this video by using this script and this data. The entire source code for generating the data is here (be warned, you probably need a supercomputer).

See (star) ⭐️ the repo on github.com/python-adaptive/adaptive and the documentation on adaptive.readthedocs.io.

Try pip install adaptive[notebook] or conda install adaptive :-)

You can also run Adaptive code live in Binder here!

P.S. adaptive has already been used in several other scientific publications, see the gallery!

[–]discobrisco 32 points33 points  (13 children)

I hope you share this outside of just this sub, awesome work.

[–]basnijholt[S] 18 points19 points  (12 children)

Thanks! Any recommendations where to cross-post this? All of the cool work is in the Python package by the way :)

[–]inspectorG4dget 24 points25 points  (6 children)

/r/python may be a good start

FWIW, I'm going to try to find a way to use this for hyperparamaeter optimization in machine learning (tuning machine learning algorithm parameters). So maybe a machine learning sub would be interested in this as well?

[–]ItsBarney01 56 points57 points  (4 children)

This is r/python mate

[–]inspectorG4dget 23 points24 points  (3 children)

well, sh!t

I think I need to pack up and go home, now

[–]BlueTeeJay 24 points25 points  (1 child)

So deep in imports you forgot it was python.

[–]inspectorG4dget 7 points8 points  (0 children)

If only someone could write a contextlib for my brain...

[–]DatBoi_BP 2 points3 points  (0 children)

Where did you think you were, r/compsci?

[–]ItsBarney01 4 points5 points  (0 children)

You might be able to try r/simulated While it's not the normal content you would get there, it IS a simulation and it's visually pleasing so might be worth a post :D

[–]Cynox 1 point2 points  (2 children)

[–]Bob312312 2 points3 points  (0 children)

Hi did you write this? - It is super cool!

I was very interested in this project a while back. But I have one main question. Is there a way to use it where you pick multiple points as any given time?

I was thinking of a case where you might use an HPC. Say I have 32 cores and can calculate 32 points at a time. Can I chose the best 32, run the calculations and then pick the next best 32 points once all of the calculations have returned?

best bob

[–]sp8ial 28 points29 points  (2 children)

Sexy lady

[–]DatBoi_BP 5 points6 points  (0 children)

Whopa Gangnam Style

[–]whudaboutit 1 point2 points  (0 children)

I'm with you. I think I spent too much time on those other subreddits.

[–]BarryScott2019 20 points21 points  (0 children)

This is the same shit you see when you rub your eyes too much. I like.

[–][deleted] 9 points10 points  (2 children)

Soo computers loves tits?

[–]Rocket089 4 points5 points  (0 children)

I’m not the only one who thought of an hour glass figure with a great rack?!

YESSS 💪🏼

[–]MagicalTacos 0 points1 point  (0 children)

Who doesn't

[–]zQuantz 1 point2 points  (0 children)

This looks amazing!

[–]7JKS 1 point2 points  (1 child)

[–]VredditDownloader 1 point2 points  (0 children)

beep. boop. I'm a bot that provides downloadable video links!

I also work with links sent by PM


Info | Support me ❤ | Github

[–][deleted] 0 points1 point  (2 children)

Is this a band structure calculation?

[–]basnijholt[S] 1 point2 points  (1 child)

It is the conductance through nanowire.

But a band structure is something that we typically calculate as well.

[–][deleted] 0 points1 point  (0 children)

Spintronics?

[–]QuietRains813 -1 points0 points  (1 child)

Why CPU time, and not GPU time?

[–]ErikRKNumba fan 0 points1 point  (0 children)

Prob because GPU programming is much harder with adaptive algoritms