Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Snektron
    @snektron:matrix.org
    [m]
    Cool application
    Troels Henriksen
    @athas
    Yeah, that's pretty cool. Would you do the visualisations with literate Futhark?
    I've also considered a variant (futhark script) that is only about the side effects of directives (reading and writing images), not about the generation of a document.
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    Yeah, just some simple plots, possibly some histogram
    But I suppose I might cram an animation in there for fun
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    What is the logic behind the numbering of the images produced by futhark literate? I've got odd numbers starting at 3 so far, and when I removed some it now starts at 13.
    Troels Henriksen
    @athas
    It's an implementation detail. Internally, futhark literate splits the file into high-level parts (code sections, text paragraphs, directives) and the image numbering is just the part index.
    That could be done better, but I'd also like to do some content-aware addressing to avoid regenerating images needlessly. In that case, the file name would be some nasty hash.
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    Ok
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    Is it possible to load values from a file into a literate futhark program?
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    what I'd like to do is to store some data in one program and restore it in another. The data is pretty expensive to generate and there are parameters to test so I'd like to decouple the generation of it from the rest
    The examples I see only use simple futhark expressions, and none of the futhark script specific syntax
    Troels Henriksen
    @athas
    Not yet, but I do want to add that.
    If you can encode your data as an image, then you can use $loadimg!
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    But could you use that data in the program?
    In this case ideally I would train at network in one program and apply it in another. Well I can deal with in haskell instead for now, but it would be nice for testing.
    Troels Henriksen
    @athas
    But right now it has to be as an image, which is clumsy.
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    Yes, that is rather inconvenient
    I mean, technically you can encode anything as an image...
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    By the way that program is pretty neat. The effect works surprisingly well.
    Troels Henriksen
    @athas
    I didn't come up with the algorithm, but I did try to create a non-optimal more parallel version.
    It has some artifacts. I suspect the sobel kernel I use for computing energy gradients is not a good choice.
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    Do you write somewhere when the C-header changes? Sometimes I don't work with the libraries for a while and notice later that Futhask can no longer handle it for whatever reason. It hasn't been difficult to fix or anything, but if there are any other users of Futhask, I kind of feel bad about not maintaining it properly. I suppose what I really should do is set up some proper testing, but the breakages haven't been frequent enough for my lazy self to do that.
    Troels Henriksen
    @athas
    I treat it as a breaking change, so it will be under Changes in CHANGELOG.md and only happen for major releases.
    At least I hope that's the case...
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    Ah, that's good to know
    Troels Henriksen
    @athas
    I actually take the C API stability much more seriously than the language itself, which is also why I'm reluctant to add short-term convenient hacks to it.
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    I very much appreciate that.
    My approach to 'testing' has basically been, if it can handle my program, it probably works.
    Snektron
    @snektron:matrix.org
    [m]
    We have some large matches on sum types (without any payload) in our code, and futhark compiles these to if-else chains
    after some investigation, it turns out that gcc and clang (at least for the c backend) don't seem to optimize those into lookup tables
    What would be the best way to get something like that?
    I assume just let A = 0 let B = 1 let C = 2 .... and let lut = ['A', 'B', 'C']
    but thats not very... readable
    Troels Henriksen
    @athas
    Hm. That's unfortunate. There's no way to make the Futhark compiler generate switch statements, so manual lookup tables with arrays is your best bet.
    Snektron
    @snektron:matrix.org
    [m]
    It seems odd to me that num_bits and the other bit functions on i64 types return i32
    Gusten Theodor Isfeldt
    @Gusten_Isfeldt_gitlab
    To be fair, it's not like there are any data types with that have that many bits. i32 math is more efficient, and you could always convert as necessary.
    If I remember correctly iterate also uses i32. So I think it's pretty consistent.
    Orestis
    @omhepia:matrix.org
    [m]
    In case it is of any interest to anybody I made a small marching cube algorithm https://github.com/omalaspinas/futcubes. It's a quick and dirty port of a C code so it may not be incredible :-D But it seems to work with the C backend (haven't tested on any other backend yet).
    Troels Henriksen
    @athas
    Cool!
    Can that be used for visualisation?
    Orestis
    @omhepia:matrix.org
    [m]
    it creates a triangularized iso-surface of a scalar field
    Snektron
    @snektron:matrix.org
    [m]
    Oh thats pretty cool :)
    Troels Henriksen
    @athas
    By the way, if any of you have problems or ideas for things that can be solved with automatic differentiation, let me know. (Preferably not deep learning/backprop.) We're building a hammer and looking for some nails.
    2 replies
    Snektron
    @snektron:matrix.org
    [m]
    What does automatic differentiation entail? Just an expression and then computing a value regarding of its derivative?
    Troels Henriksen
    @athas
    At a high level, yes. Computing derivatives of (in principle) arbitrary functions at some point.
    Including functions that are not differentiable everywhere.
    Snektron
    @snektron:matrix.org
    [m]
    My first thought would be some physics application
    Troels Henriksen
    @athas
    It's historically used a lot for optimisation problems in engineering. You can also use it to convert distance functions into surface normal functions.
    1 reply