OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-generate commits / 2190c3e

Wave-function collapse algorithm
2190c3e24cc79cc9e4f8d0fa57807e7b2a449e89
by Linas Vepstas <linasvepstas@gmail.com> · 2021-06-14T13:57:46.000Z

Changed files (1) +26 -0

Design-Notes.md +26 -0
……@@ -92,3 +92,29 @@ different subjects).
9292
9393Do we need to have explicit "must-form-a-cycle" rules? Can we do this
9494statistically?
95
96
97
98Literature
99==========
100
101Wave-function Collapse
102----------------------
103The "wave-function collapse algorithm" described by Marian, "[Infinite
104procedurally generated city with the Wave Function Collapse
105algorithm](https://marian42.de/article/wfc/)" (2019) appears to be a
106good way of assembling pieces in a fixed n-dimensional world.
107
108It divides the universe into blocks (for sentence generation, this would
109be a 1-D universe - a linear string). It selects a location in this
110grid, picking the grid-point with the lowest entropy. Naively, this is
111the slot with the fewest choices. More formally, its the slot with the
112smallest S = -sum_i p_i log p_i where -log p_i is the "cost". A single
113probability-weighted choice is made for that slot, and then the process
114is repeated.
115
116It is not clear how to enforce additional conditions, such as
117no-links-crossing, with this algo.
118
119Code for the blocks-world algo is here:
120https://github.com/mxgmn/WaveFunctionCollapse