Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Sheehan Olver
    @dlfivefifty
    Clenshaws algorithm
    Simon
    @SimonDanisch
    could you turn it into a broadcast, as in f.(matrix), where f is a non allocating pure function?
    Christopher Rackauckas
    @ChrisRackauckas
    oh, so it's the evaluation of the basis, not the projection to the basis?
    Sheehan Olver
    @dlfivefifty
    Simon
    @SimonDanisch
    @time u=\(QR,C*u;tolerance=1E-5)
      5.121884s
    that's what I mean with slow, btw ;)
    Sheehan Olver
    @dlfivefifty
    The first step builds up the cache
    Simon
    @SimonDanisch
    but that was the third
    am I on some old version, maybe?
    Sheehan Olver
    @dlfivefifty
    @ChrisRackauckas evaluating an expansion in a basis, you don't construct the basis itself (though maybe that's better...) it's a generalisation of Horner algorithm
    It grows the cache adaptively
    Christopher Rackauckas
    @ChrisRackauckas
    I see
    so the Clenshaw algorithm is the name for the recursive algorithm for generating the Chebyshev polynomials? And you are not constructing the basis, just evaluating the expansion in the Chebyschev basis until some tolerance is reached?
    Sheehan Olver
    @dlfivefifty
    @SimonDanisch it grows the cache adaptively. The third step the solution is growing so the cache needs to grow. Eventually it saturates and the cache is sufficient
    Christopher Rackauckas
    @ChrisRackauckas
    I'll take my ApproxFun questions over to your channel.
    Sheehan Olver
    @dlfivefifty
    @ChrisRackauckas no you don't generate the basis. It evaluates the expansion directly, in reverse order. So a backward recurrence instead of forward
    The expansion is already finite once it's calculated, so not adaptive
    Simon
    @SimonDanisch
    hm... it seems like it even gets slower...
    I'm on frame 10 and started it a couple of minutes ago
    still on 11 ... it definitely gets a lot slower over time...
    Simon
    @SimonDanisch
    okay, I added video streaming, which should be lots faster than previous options to capture a glvisualize video
    also, i adapted your example to incorperate the video streaming, plus computing in a different process ;)
    I've change the example to use rand instead of your calculation... it was simply too slow to play around with it productively
    addprocs(1)
    workid = workers()[end]
    @everywhere using ApproxFun, MultivariateOrthogonalPolynomials, FixedSizeArrays
    @everywhere import MultivariateOrthogonalPolynomials: plan_evaluate
    using Plots, GLVisualize
    window = glscreen()
    @async GLWindow.waiting_renderloop(window)
    
    N = 600
    x = linspace(0f0, 2f0, N)
    X = x * fill(1, (1, N))
    Y = fill(1, (N, 1)) * x'
    Z = rand(Float32, N, N)
    vis = visualize((X,Y,Z), :surface)
    _view(vis)
    
    test = homedir()*"/test.mkv"
    # framerate should rather be dynamic... not sure how to set that up
    # you'll need ffmpeg installed and in the path!
    io, buffer = GLVisualize.create_video_stream(test, window)
    
    while isopen(window)
        # lets run this in another process, to not freeze GLVisualize
        Z = remotecall_fetch(workid, X) do X
            Z = map(x-> rand(Float32), X)
            sleep(1.0) # simulate compute
            Z
        end
        GLAbstraction.set_arg!(vis, :position_z, Z)
        yield()
        GLVisualize.add_frame!(io, window, buffer)
    end
    close(io) # flush video stream and write it out
    Sheehan Olver
    @dlfivefifty
    still on 11 ... it definitely gets a lot slower over time...
    Are you calling chop!(u,1E-7)? Otherwise, the length will continue to grow
    Ah, you also have to be on development branch, as I fixed a bug in C*u
    Here are the first 30 timings I get for the \ call, after which the cache is saturated:
    7.304524 seconds (8.82 M allocations: 359.695 MB, 4.72% gc time)
    0.125730 seconds (918.71 k allocations: 36.406 MB, 15.14% gc time)
    0.039326 seconds (407.21 k allocations: 16.920 MB, 18.97% gc time)
    0.149589 seconds (1.24 M allocations: 50.234 MB, 9.35% gc time)
    0.050394 seconds (532.56 k allocations: 25.093 MB, 15.35% gc time)
    0.204626 seconds (1.50 M allocations: 66.800 MB, 9.83% gc time)
    0.070000 seconds (724.71 k allocations: 37.035 MB, 20.15% gc time)
    0.273435 seconds (2.07 M allocations: 91.187 MB, 10.05% gc time)
    0.087758 seconds (916.75 k allocations: 49.822 MB, 16.80% gc time)
    0.337919 seconds (2.21 M allocations: 102.332 MB, 9.86% gc time)
    0.108402 seconds (1.11 M allocations: 64.994 MB, 19.87% gc time)
    0.421876 seconds (2.66 M allocations: 128.766 MB, 10.62% gc time)
    0.117251 seconds (1.23 M allocations: 77.739 MB, 18.96% gc time)
    0.099575 seconds (983.38 k allocations: 64.140 MB, 22.33% gc time)
    0.389930 seconds (2.58 M allocations: 137.161 MB, 10.65% gc time)
    0.090729 seconds (847.95 k allocations: 58.760 MB, 23.54% gc time)
    0.181969 seconds (2.53 M allocations: 113.650 MB, 19.34% gc time)
    0.002410 seconds (11.35 k allocations: 385.234 KB)
    0.002426 seconds (11.35 k allocations: 385.234 KB)
    0.002276 seconds (11.35 k allocations: 385.234 KB)
    0.220088 seconds (2.50 M allocations: 145.678 MB, 19.57% gc time)
    0.126966 seconds (1.80 M allocations: 72.297 MB, 23.87% gc time)
    0.128421 seconds (1.22 M allocations: 83.452 MB, 23.05% gc time)
    0.002607 seconds (11.74 k allocations: 400.203 KB)
    0.002568 seconds (11.74 k allocations: 400.203 KB)
    0.002811 seconds (11.74 k allocations: 400.203 KB)
    0.009862 seconds (11.74 k allocations: 400.203 KB, 70.61% gc time)
    0.002601 seconds (11.74 k allocations: 400.203 KB)
    0.002610 seconds (11.74 k allocations: 400.203 KB)
    0.002639 seconds (11.74 k allocations: 400.203 KB)
    Simon
    @SimonDanisch
    that looks more reasonable :)
    Sheehan Olver
    @dlfivefifty
    How do I clear a plot?
    alblaz
    @alblaz
    @SimonDanisch I bump again into ERROR: UndefVarError: post_empty not defined when using GLVisualize with Plots. My current version of Reactive is v0.3.7. Any ideas?
    alblaz
    @alblaz
    I checked the source code of Reactive and it seems that in the latest version post_empty is not defined. I pinned Reactive to v"0.3.6" and I don't get the error anymore.
    alblaz
    @alblaz
    @SimonDanisch I've been experimenting with GLVisualize, Plots and Reactive's Signals. For inspiration I used your example GLPlot.jl/example/SignalProcessing/imfilter_pipeline.jl. The example I made is sort of rough but it seems to be working https://gist.github.com/alblaz/5789d069c821e5817d3a9f98e1fba10b :)
    alblaz
    @alblaz
    ยดยดยด
    alblaz
    @alblaz
    The only problem I found is when calling multiple time this script within the same repl session. In this case old signals can mess up the result. Calling unpreserve and gc seems to solve the problem though.
    Simon
    @SimonDanisch
    Sorry, didn't get any notifications
    Concerning the signals, i started using this pattern:
    isdefined(:x) && close(x, false)
    x = Signal(...)
    Simon
    @SimonDanisch
    my longterm plan is to offer an easy way to bind signals to the lifetime of the window
    alblaz
    @alblaz
    Thank @SimonDanisch for the answer i will experiment with this! I also didn't have notification on :smile:
    Michael Krabbe Borregaard
    @mkborregaard
    Hi, for GLVisualize, how should one create and save the 3D objects used as assets?
    Simon
    @SimonDanisch
    Hi
    what do you mean exactly? storage file format?
    Michael Krabbe Borregaard
    @mkborregaard
    I am rather more blank than that :-) Can you define the models in GLVisualize or do you need external 3d-modelling software? If yes to the latter, then yes, what storage file format? Thanks!
    Simon
    @SimonDanisch
    I see ;)
    well you can build the models programmatically ;)
    but not really interactively yet
    what do you want to do?
    Michael Krabbe Borregaard
    @mkborregaard
    I was philosophisizing over the magnet skyrmion images from this question https://discourse.julialang.org/t/visualizing-a-3d-vectorfield/3852 and thought replicating them would be an easy way to learn a bit more glvisualize (defining an arrow (particle) as a cylinder and cone, then generating the image by mapping a 3d-rotation, position and colormap). It has no practical application for me so it is low(no)-priority - I was just trying to get to grips with the programming logic of the package :-)
    Simon
    @SimonDanisch
    ah okay!