Skip to content

Instantly share code, notes, and snippets.

import tensorflow as tf
def generate_gol_example(size):
"""Generates a random pair of Game of Life 2D world and its next time step.
For a reference on Game of Life, see
[Wikipedia page](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).
The implementation assumes:
* 2D square world of fixed size.
import tensorflow as tf
def gol_loss(world_next_probabilities, world_next_target):
"""Calculates loss between 2D Game of Life predictions and targets.
For a reference on Game of Life, see
[Wikipedia page](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).
The implementation assumes:
* 2D square world of fixed size.
var SearchForm = Frame.createClass({
render: function() {
return (
<input id="search-box" type="text" />
<input id="search-button" type="button" />
)
}
});
var SearchResults = Frame.createClass({
function emptySet(x) {
return false;
}
function insert(elem, set) {
return function(x) {
if (x === elem) { // insert smarter comparison here if needed
return true;
}
return function() { return contains(x, set); };