Skip to content
Snippets Groups Projects
Commit 31751035 authored by Tim O'Donnell's avatar Tim O'Donnell
Browse files

Reseed the numpy random number generator in each worker

parent c9e89845
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@ base_hyperparameters = {
grid = []
for train_subset in ["all", "quantitative"]:
for minibatch_size in [32]:
for minibatch_size in [128]:
for dense_layer_size in [8, 16, 32, 64]:
for l1 in [0.0, 0.001]:
for num_lc in [0, 1, 2]:
......
......@@ -10,6 +10,7 @@ import traceback
import random
from functools import partial
import numpy
import pandas
import yaml
from mhcnames import normalize_allele_name
......@@ -472,6 +473,9 @@ def calibrate_percentile_ranks(allele, predictor, peptides=None):
def worker_init(keras_backend=None, gpu_device_nums=None):
# Each worker needs distinct random numbers
numpy.random.seed()
random.seed()
if keras_backend or gpu_device_nums:
print("WORKER pid=%d assigned GPU devices: %s" % (
os.getpid(), gpu_device_nums))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment