This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Paxos Proposer --- | |
proposer(v): | |
choose n > n_p | |
send prepare(n) to all servers including self | |
if prepare_ok(n, n_a, v_a) from majority: | |
v’ = v_a with highest n_a; choose own v otherwise | |
send accept(n, v’) to all | |
if accept_ok(n) from majority: | |
send decided(v’) to all | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Typical setup to include TensorFlow. | |
import tensorflow as tf | |
# Make a queue of file names including all the JPEG images files in the relative | |
# image directory. | |
filename_queue = tf.train.string_input_producer( | |
tf.train.match_filenames_once("./images/*.jpg")) | |
# Read an entire image file which is required since they're JPEGs, if the images | |
# are too large they could be split in advance to smaller files or use the Fixed |