change remote function invocation from func() to func.remote() (#328)

This commit is contained in:
Robert Nishihara
2016-07-31 15:25:19 -07:00
committed by Philipp Moritz
parent 92f1976e94
commit 0e5b858324
19 changed files with 219 additions and 215 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ computation. Instead, it simply submits a number of tasks to the scheduler.
result_refs = []
for _ in range(100):
params = generate_random_params()
results.append((params, train_cnn_and_compute_accuracy(params, epochs)))
results.append((params, train_cnn_and_compute_accuracy.remote(params, epochs)))
```
If we wish to wait until the results have all been retrieved, we can retrieve
+1 -1
View File
@@ -37,7 +37,7 @@ if __name__ == "__main__":
dropout = np.random.uniform(0, 1)
stddev = 10 ** np.random.uniform(-5, 5)
params = {"learning_rate": learning_rate, "batch_size": batch_size, "dropout": dropout, "stddev": stddev}
results.append((params, hyperopt.train_cnn_and_compute_accuracy(params, epochs, train_images, train_labels, validation_images, validation_labels)))
results.append((params, hyperopt.train_cnn_and_compute_accuracy.remote(params, epochs, train_images, train_labels, validation_images, validation_labels)))
# Fetch the results of the tasks and print the results.
for i in range(trials):