Earlier quoted context omitted.
About harder and easier to satisfy, the question of how the rate at which the algorithm runs into contradictions depends on the input is not easy at all. There is no simple correlations between the contradiction rate and the size of the input. But the first thing you'll notice if you feed it an image with a lot of patterns, is that it will work very slowly. Yeah, the corpus thing can be done if we cut out rare patter…
I wonder if it would be interesting to purposely search for tilesets that maximize contradiction rate. What would those things look like?
Show HN: Wave function collapse algorithm
111–120 of 127 posts
Re: Show HN: Wave function collapse algorithm
#112As I understand it: this treats image generation as constraint satisfaction. The constraints are that each NxN patch appears in the source image. The satisfaction method is arc consistency https://en.wikipedia.org/wiki/AC-3_algorithm , except, when that settles down prematurely, pick the least-constrained patch and make a random valid choice, then continue. (If this leads to getting stuck, then give up instead of bac…
Re: Show HN: Wave function collapse algorithm
#113Earlier quoted context omitted.
If you use overlapping model (there are 2 models in the repo) with 1xN patterns, it would be a the same as (N-1)th order Markov chain.
Can you explain the difference between the overlapping and non-overlapping models?
Re: Show HN: Wave function collapse algorithm
#114As I understand it: this treats image generation as constraint satisfaction. The constraints are that each NxN patch appears in the source image. The satisfaction method is arc consistency https://en.wikipedia.org/wiki/AC-3_algorithm , except, when that settles down prematurely, pick the least-constrained patch and make a random valid choice, then continue. (If this leads to getting stuck, then give up instead of bac…
Yes, (C1) is a constraint problem. But we also want to satisfy (C2) as close as possible, otherwise we could have just colored some outputs in a single color.
I don't understand about "a single color" unless you mean setting all output pixels to the same color, which would only satisfy the constraints if the input has an NxN patch all one color.
I hope my comment didn't seem to imply that the work seemed unoriginal. I don't think that; I wanted to check my reading.
Re: Show HN: Wave function collapse algorithm
#115Can this approach be used to generate "missing parts" in unfinished song? If composer has few good parts but is too lazy to finish the whole piece, for example? Or to "extend" Moonlight for example?
Re: Show HN: Wave function collapse algorithm
#116Earlier quoted context omitted.
Yes, (C1) is a constraint problem. But we also want to satisfy (C2) as close as possible, otherwise we could have just colored some outputs in a single color.
Yes, I took that to mean, when you're making a random valid choice, the weights come from the input distribution. I don't understand about "a single color" unless you mean setting all output pixels to the same color, which would only satisfy the constraints if the input has an NxN patch all one color. I hope my comment didn't seem to imply that the work seemed unoriginal. I don't think that; I wanted to check my read…
You understood right, it's constraints + probabilities.
Btw, I have different algorithm that satisfies (C2) perfectly, but not (C1): https://github.com/mxgmn/ConvChain
Re: Show HN: Wave function collapse algorithm
#117Earlier quoted context omitted.
Yes, I took that to mean, when you're making a random valid choice, the weights come from the input distribution. I don't understand about "a single color" unless you mean setting all output pixels to the same color, which would only satisfy the constraints if the input has an NxN patch all one color. I hope my comment didn't seem to imply that the work seemed unoriginal. I don't think that; I wanted to check my read…
Most of the examples in the repo have those NxN all one color patches. Or, without (C2) the algorithm would have generated completely empty integrated circuits, or completely grass terrain, which is really boring. You understood right, it's constraints + probabilities. Btw, I have different algorithm that satisfies (C2) perfectly, but not (C1): https://github.com/mxgmn/ConvChain
I might try this approach to generate formal poetry -- it's something I've done by backtracking before, and I'd considered doing something like your ConvChain.
Re: Show HN: Wave function collapse algorithm
#118Re: Show HN: Wave function collapse algorithm
#119Earlier quoted context omitted.
Yes, (C1) is a constraint problem. But we also want to satisfy (C2) as close as possible, otherwise we could have just colored some outputs in a single color.
Yes, I took that to mean, when you're making a random valid choice, the weights come from the input distribution. I don't understand about "a single color" unless you mean setting all output pixels to the same color, which would only satisfy the constraints if the input has an NxN patch all one color. I hope my comment didn't seem to imply that the work seemed unoriginal. I don't think that; I wanted to check my read…
The algorithm used is exactly what you described here. It wasn't obvious to me that probability density functions were not tracked (the algorithm only tracks which NxN patch are allowed at each location) and randomness only come into play when a random valid choice is made, and there each valid patch is chosen probability proportional to its number of occurrence in the input.
Re: Show HN: Wave function collapse algorithm
#120Fantastic stuff. I love it! As with most meachine learning stuff and these very cool ideas (of which I am very hazy on, esp their categorizations) I immediately want to use it for our lab's brain work. We have a LOT of 3-D images (per voxel is ~200nmx200nmx~600nm for a lot of 1028x1028 .tiff images all stitched together) and would love to feed these images BACKWARDS into this. IE we have the 'far field', and we want…
Sounds like an altogether easier problem, assuming you don't care to compensate for noise in your data somehow - supposing you want to identify all distinct m×n×k-sized "elements", simply use some appropriate rolling hash[1] (i.e. a hash of a window that you can update in constant time as you slide the window) as a key mapping to a list of "elements" you have seen so far with that hash, and only do pointwise comparis…
Still, thanks a ton for this info! I think it can really help with some computational bio stuff another lab is working on here (viral similarity in genes in your DNA)